def test_update(self, con): some_id = 'some id' some_dict = { 'title': "some title", 'excludeUttWithoutEntities': True, 'searchDictionaries': [], 'files': 'some files', 'chunk': 'PAGE', 'numWorkers': 8 } some_response = "some id, {'excludeUttWithoutEntities': True, 'numWorkers': 8, 'chunk': 'PAGE', " \ "'title': 'some title', 'searchDictionaries': [], 'files': 'some files'}" some_list = ["test.txt"] model = Model() response = Mock() response.json.return_value = some_dict con.return_value = response res = model.update(some_id, some_list) self.assertEqual(str(res), some_response)
def test_update_list_arg_err(self): model = Model() with self.assertRaises(QtArgumentError): model.update(model_id="some_id", update_files="file")
def test_update_model_id_arg_error(self): model = Model() with self.assertRaises(QtArgumentError): model.update(model_id=[], update_files=["test.txt"])