1from __future__ import print_function, division, absolute_import, unicode_literals 2from fontTools.misc.py23 import * 3from fontTools.ttLib.tables._f_p_g_m import table__f_p_g_m 4from fontTools.ttLib.tables import ttProgram 5 6 7def test__bool__(): 8 fpgm = table__f_p_g_m() 9 assert not bool(fpgm) 10 11 p = ttProgram.Program() 12 fpgm.program = p 13 assert not bool(fpgm) 14 15 bc = bytearray([0]) 16 p.fromBytecode(bc) 17 assert bool(fpgm) 18 19 p.bytecode.pop() 20 assert not bool(fpgm) 21