def test_set_constants(): for c in CONSTANTS: foo = openclip.const(c) if isinstance(foo,str): openclip.set_const(c, 'Foo') assert openclip.const(c) == 'Foo' openclip.set_const(c,foo) assert openclip.const(c) == foo if isinstance(foo,int): openclip.set_const(c, 5) assert openclip.const(c) == 5 openclip.set_const(c,foo) assert openclip.const(c) == foo
def set_invalid_constant_attribs(): __tracebackhide__ = True return openclip.set_const('NOT_A_CONSTANT')
def set_invalid_constant(): __tracebackhide__ = True return openclip.set_const('NOT_A_CONSTANT', 'BAD VALUE')