Пример #1
0
 def test_loads(self):
     with pytest.raises(NotImplementedError):
         BaseSerializer().loads('')
Пример #2
0
 def test_init_encoding(self):
     serializer = BaseSerializer(encoding='whatever')
     assert serializer.DEFAULT_ENCODING == 'utf-8'
     assert serializer.encoding == 'whatever'
Пример #3
0
 def test_dumps(self):
     with pytest.raises(NotImplementedError):
         BaseSerializer().dumps("")
Пример #4
0
 def test_init(self):
     serializer = BaseSerializer()
     assert serializer.DEFAULT_ENCODING == 'utf-8'
     assert serializer.encoding == 'utf-8'
Пример #5
0
 def test_init_encoding(self):
     serializer = BaseSerializer(encoding="whatever")
     assert serializer.DEFAULT_ENCODING == "utf-8"
     assert serializer.encoding == "whatever"