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