From 590ee643766aa18b5f2b6c738cfd5358e69ebbfe Mon Sep 17 00:00:00 2001 From: Fernando Diaz Date: Thu, 23 Apr 2015 11:14:00 -0500 Subject: Added a testcase to cover ValueError in tag.py Added a new testcase to cover a ValueError raised in generate_name_value_tag Change-Id: Ia07bc8c5c3d1586d1d9c6fd11a1c508a74bedc61 --- pycadf/tests/audit/test_api.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pycadf') diff --git a/pycadf/tests/audit/test_api.py b/pycadf/tests/audit/test_api.py index 96dcb0b..50c21ce 100644 --- a/pycadf/tests/audit/test_api.py +++ b/pycadf/tests/audit/test_api.py @@ -323,6 +323,18 @@ class TestAuditApi(base.TestCase): self.assertEqual(payload['observer']['id'], 'target') self.assertNotIn('reporterchain', payload) + def test_missing_tag(self): + req = self.api_request('GET', 'http://admin_host:8774/v2/' + + str(uuid.uuid4()) + '/os-migrations') + tmpfile = self.temp_config_file_path() + with open(tmpfile, "w") as f: + f.write("[DEFAULT]\n") + f.write("api_paths = servers\n\n") + f.write("[service_endpoints]\n") + f.write("compute = service/compute") + audit_api = api.OpenStackAuditApi(tmpfile) + self.assertRaises(ValueError, audit_api.create_event, req, None) + class TestAuditApiConf(base.TestCase): def test_missing_default_option(self): -- cgit v1.2.1