Пример #1
0
 def test_decode_value_invalid(self):
     with pytest.raises(AssertionError):
         zoo._decode_value("foobar")
Пример #2
0
 def test_decode_value_none(self):
     assert zoo._decode_value(pickle.dumps(None)) is None
Пример #3
0
 def test_decode_value_empty(self):
     assert zoo._decode_value(b"") == zoo.EmptyValue
Пример #4
0
 def test_decode_value(self):
     obj = ("foobar", )
     decoded = zoo._decode_value(pickle.dumps(obj))
     assert decoded == obj
Пример #5
0
 def test_decode_value_invalid(self):
     with pytest.raises(AssertionError):
         zoo._decode_value("foobar")
Пример #6
0
 def test_decode_value_empty(self):
     assert zoo._decode_value(b"") == zoo.EmptyValue
Пример #7
0
 def test_decode_value_none(self):
     assert zoo._decode_value(pickle.dumps(None)) is None
Пример #8
0
 def test_decode_value(self):
     obj = ("foobar",)
     decoded = zoo._decode_value(pickle.dumps(obj))
     assert decoded == obj