def test_decode(self, json): s = '1234' decoded = JSON.decode(s) json.loads.assert_called_once_with(s) self.assertEqual(decoded, json.loads.return_value)
def test_encode(self, json): s = '1234' encoded = JSON.encode(s) json.dumps.assert_called_once_with(s) self.assertEqual(encoded, json.dumps.return_value)