示例#1
0
 def test_search_size_not_int_arg(self):
     model_id = "test"
     param_from = 5
     size = "test"
     model = Model()
     with self.assertRaises(QtArgumentError):
         model.search(model_id, param_from, size)
示例#2
0
 def test_search_pairs_arg(self):
     index = "test"
     param_from = 5
     size = 100
     model = Model()
     f1 = "string"
     with self.assertRaises(QtArgumentError):
         model.search(index, param_from, size, f1)
示例#3
0
 def test_search(self, con):
     some_id = 'some id'
     some_dict = {"key": "value"}
     model = Model()
     response = Mock()
     response.json.return_value = some_dict
     con.return_value = response
     res = model.search(some_id)
     self.assertEqual(res, some_dict)
示例#4
0
 def test_search_size_range_arg(self):
     model = Model()
     with self.assertRaises(QtArgumentError):
         model.search(model_id="some_model", param_from=5, size=201)
示例#5
0
 def test_search_param_from_arg_error(self):
     model = Model()
     with self.assertRaises(QtArgumentError):
         model.search(model_id="some_model", param_from="123")
示例#6
0
 def test_search_model_id_arg(self):
     model = Model()
     with self.assertRaises(QtArgumentError):
         model.search(model_id=123)