コード例 #1
0
 def test_decode_RAISE_when_INPUT_WRONG_TYPE(self):
     with self.assertRaises(TypeError):
         JsonTypeCase.decode(self.wrong_type_input)
コード例 #2
0
 def test_decode_RETURN_NONE(self):
     assert JsonTypeCase.decode(None) == None
コード例 #3
0
 def test_decode_RETURN_JSONABLE(self):
     assert JsonTypeCase.decode(json.dumps(self.s)) == self.s
コード例 #4
0
 def test_encode_with_JSONABLE(self):
     assert JsonTypeCase.encode(self.s) == json.dumps(self.s)
コード例 #5
0
 def test_encode_RAISE_when_INPUT_UN_JSONABLE(self):
     with self.assertRaises(TypeError):
         JsonTypeCase.encode(self.wrong_type_input)
コード例 #6
0
 def test_decode_RAISE_when_INPUT_WRONG_TYPE(self):
     with self.assertRaises(TypeError):
         JsonTypeCase.decode(self.wrong_type_input)
コード例 #7
0
 def test_decode_RETURN_JSONABLE(self):
     assert JsonTypeCase.decode(json.dumps(self.s)) == self.s
コード例 #8
0
 def test_decode_RETURN_NONE(self):
     assert JsonTypeCase.decode(None) == None
コード例 #9
0
 def test_encode_RAISE_when_INPUT_UN_JSONABLE(self):
     with self.assertRaises(TypeError):
         JsonTypeCase.encode(self.wrong_type_input)
コード例 #10
0
 def test_encode_with_JSONABLE(self):
     assert JsonTypeCase.encode(self.s) == json.dumps(self.s)