Beispiel #1
0
 def test_process_result_value(self):
     t = types.JSONEncodedDict()
     self.assertEqual({"a": 1}, t.process_result_value("{\"a\": 1}", None))
     t = types.JSONEncodedList()
     self.assertEqual([[2, 1], [1, 2]],
                      t.process_result_value("[[2, 1], [1, 2]]", None))
     with mock.patch("json.loads") as mock_json_loads:
         t.process_result_value("[[2, 1], [1, 2]]", None)
         mock_json_loads.asser_called_once_with([(2, 1), (1, 2)])
Beispiel #2
0
 def test_process_result_value_none(self):
     t = types.JSONEncodedDict()
     self.assertIsNone(t.process_result_value(None, None))
     t = types.JSONEncodedList()
     self.assertIsNone(t.process_result_value(None, None))
Beispiel #3
0
 def test_process_bind_param_none(self):
     t = types.JSONEncodedDict()
     self.assertIsNone(t.process_bind_param(None, None))
Beispiel #4
0
 def test_process_bind_param(self):
     t = types.JSONEncodedDict()
     self.assertEqual("{\"a\": 1}", t.process_bind_param({"a": 1}, None))