From 709787048e8ebba415b75348f2e7dc4703110d65 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Wed, 13 Jun 2018 14:45:19 +0800 Subject: Add test_list_servers_unauth Add test_list_servers_unauth Change-Id: Ie16ed282e0394aa06fce7728036994d425b026a0 Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn --- vio/vio/tests/test_fake_nova_view.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py index 5e56f0f..34c58a6 100644 --- a/vio/vio/tests/test_fake_nova_view.py +++ b/vio/vio/tests/test_fake_nova_view.py @@ -59,6 +59,14 @@ class TestFakeNovaServer(unittest.TestCase): resp = self.view.get(req, "abcd") self.assertEqual(200, resp.status_code) + def test_list_servers_unauth(self): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": "invalid" + } + resp = self.view.get(req, "abcd") + self.assertEqual(401, resp.status_code) + class TestFakeNovaHypervisors(unittest.TestCase): -- cgit 1.2.3-korg