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)
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)
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)
def test_search_size_range_arg(self): model = Model() with self.assertRaises(QtArgumentError): model.search(model_id="some_model", param_from=5, size=201)
def test_search_param_from_arg_error(self): model = Model() with self.assertRaises(QtArgumentError): model.search(model_id="some_model", param_from="123")
def test_search_model_id_arg(self): model = Model() with self.assertRaises(QtArgumentError): model.search(model_id=123)