def test_generator_success(self): """ test that the generator correctly creates an error """ test_error = 'NO_RESULTS' err_data, _ = errors.construct_err(err_name=test_error) err_data = json.loads(err_data) self.assertDictEqual(errors.error_definitions[test_error], err_data)
def test_generator_default(self): """ test that the generator correctly creates a default error """ err_data, _ = errors.construct_err() err_data = json.loads(err_data) self.assertDictEqual(errors.error_definitions['DEFAULT'], err_data)
def test_generator_name_fail(self): """ test that the generator correctly defaults with a bad err name """ err_data, _ = errors.construct_err(err_name='IMAGINARY_ERROR') err_data = json.loads(err_data) self.assertDictEqual(errors.error_definitions['DEFAULT'], err_data)