From a2066c9fbed8a99eff5b5507918d1d8f56b91a6c Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Tue, 17 Jan 2017 10:36:40 +0000 Subject: [PATCH] [Tests] convert _f_p_g_m doctests into _f_p_g_m_test.py --- Tests/ttLib/tables/_f_p_g_m_test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Tests/ttLib/tables/_f_p_g_m_test.py diff --git a/Tests/ttLib/tables/_f_p_g_m_test.py b/Tests/ttLib/tables/_f_p_g_m_test.py new file mode 100644 index 000000000..71fec4816 --- /dev/null +++ b/Tests/ttLib/tables/_f_p_g_m_test.py @@ -0,0 +1,20 @@ +from __future__ import print_function, division, absolute_import, unicode_literals +from fontTools.misc.py23 import * +from fontTools.ttLib.tables._f_p_g_m import table__f_p_g_m +from fontTools.ttLib.tables import ttProgram + + +def test__bool__(): + fpgm = table__f_p_g_m() + assert not bool(fpgm) + + p = ttProgram.Program() + fpgm.program = p + assert not bool(fpgm) + + bc = bytearray([0]) + p.fromBytecode(bc) + assert bool(fpgm) + + p.bytecode.pop() + assert not bool(fpgm)