def test_fetch(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, {'title': 'some title', 'excludeUttWithoutEntities': True, 'numWorkers': 8, " \ "'chunk': 'PAGE', 'searchDictionaries': [], 'files': 'some files'}" model = Model() response = Mock() response.json.return_value = some_dict con.return_value = response res = model.fetch(some_id) self.assertEqual(str(res), some_response)
def test_fetch_model_id_arg_err(self): model = Model() with self.assertRaises(QtArgumentError): model.fetch(model_id=[])