Exemple #1
0
def test_simple():
    c = get_constant('foo')
    assert str(c) == 'foo'
    assert repr(c) == '<Constant: FOO>'
Exemple #2
0
def test_base_class():
    c = get_constant('Bar', bases=(int, ), init_value=24)
    assert c == 24
    assert str(c) == 'Bar'
    assert repr(c) == '<Constant: BAR>'
Exemple #3
0
def test_persistence():
    c = get_constant('baz', bases=(float, ), init_value=6.5)
    assert c is get_constant('baz')