コード例 #1
0
 def test_bytes(self):
     res = t.FromBytes().check(b"foo")
     assert res == 'foo'
     res = t.FromBytes()(b"")
     assert res == ''
     res = t.FromBytes().check(b"")
     assert res == ''
     res = extract_error(t.FromBytes(), 1)
     assert res == 'value is not a bytes'
コード例 #2
0
 def test_repr(self):
     res = t.FromBytes()
     assert repr(res) == '<FromBytes>'