summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vio/vio/tests/test_fake_identity_view.py17
-rw-r--r--vio/vio/tests/test_fake_nova_view.py8
2 files changed, 25 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_identity_view.py b/vio/vio/tests/test_fake_identity_view.py
index e27a8c4..2dde2d6 100644
--- a/vio/vio/tests/test_fake_identity_view.py
+++ b/vio/vio/tests/test_fake_identity_view.py
@@ -40,6 +40,23 @@ class TestFakeProjects(unittest.TestCase):
resp = self.view.get(req, "1234abcd")
self.assertEqual(200, resp.status_code)
+ def test_list_projects(self):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": Token
+ }
+ resp = self.view.get(req)
+ self.assertEqual(200, resp.status_code)
+ self.assertEqual(3, len(resp.data['projects']))
+
+ def test_list_projects_unauth(self):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": "invalid"
+ }
+ resp = self.view.get(req)
+ self.assertEqual(401, resp.status_code)
+
class TestFakeToken(unittest.TestCase):
diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py
index c1c725d..5e56f0f 100644
--- a/vio/vio/tests/test_fake_nova_view.py
+++ b/vio/vio/tests/test_fake_nova_view.py
@@ -51,6 +51,14 @@ class TestFakeNovaServer(unittest.TestCase):
resp = self.view.delete(req, "abcd", Server)
self.assertEqual(204, resp.status_code)
+ def test_list_servers(self):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": Token
+ }
+ resp = self.view.get(req, "abcd")
+ self.assertEqual(200, resp.status_code)
+
class TestFakeNovaHypervisors(unittest.TestCase):