def test___repr__():
     wrapped = model._BaseValue(b"abc")
     assert repr(wrapped) == "_BaseValue(b'abc')"
 def test_constructor_invalid_input():
     with pytest.raises(TypeError):
         model._BaseValue(None)
     with pytest.raises(TypeError):
         model._BaseValue([1, 2])
Esempio n. 3
0
 def test__opt_call_to_base_type_wrapped():
     prop = model.Property(name="prop")
     value = model._BaseValue(b"\x00\x01")
     assert value is prop._opt_call_to_base_type(value)
     # Cache is untouched.
     assert model.Property._FIND_METHODS_CACHE == {}
 def test_constructor():
     wrapped = model._BaseValue(17)
     assert wrapped.b_val == 17
Esempio n. 5
0
 def test___hash__():
     wrapped = model._BaseValue((11, 12, 88))
     with pytest.raises(TypeError):
         hash(wrapped)