diff options
author | Dolph Mathews <dolph.mathews@gmail.com> | 2012-03-23 10:46:16 -0500 |
---|---|---|
committer | Dolph Mathews <dolph.mathews@gmail.com> | 2012-03-27 17:05:59 -0700 |
commit | 16caf2083027eed84f042f7d2a97168e2f42a770 (patch) | |
tree | a29a0264f96cac02af23efd56f490aed0b5ffec5 /tests/test_keystoneclient.py | |
parent | 5c8dcd2f2f1a7645f93f39c3f5784920e2099998 (diff) | |
download | keystone-16caf2083027eed84f042f7d2a97168e2f42a770.tar.gz keystone-16caf2083027eed84f042f7d2a97168e2f42a770.tar.xz keystone-16caf2083027eed84f042f7d2a97168e2f42a770.zip |
user-crud 404 (bug 963056)
user-create
user-get
user-list
user-update
user-update-password
user-delete
Change-Id: I7762aaaae9817ea7426039e4700e16b59e18cba1
Diffstat (limited to 'tests/test_keystoneclient.py')
-rw-r--r-- | tests/test_keystoneclient.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/test_keystoneclient.py b/tests/test_keystoneclient.py index 7c530133..457d241f 100644 --- a/tests/test_keystoneclient.py +++ b/tests/test_keystoneclient.py @@ -336,6 +336,61 @@ class KeystoneClientTests(object): tenant_id='bar') self.assertEquals(user2.name, test_username) + def test_user_create_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.users.create, + name=uuid.uuid4().hex, + password=uuid.uuid4().hex, + email=uuid.uuid4().hex, + tenant_id=uuid.uuid4().hex) + + def test_user_get_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.users.get, + user=uuid.uuid4().hex) + + def test_user_list_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.users.list, + tenant_id=uuid.uuid4().hex) + + def test_user_update_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.users.update, + user=uuid.uuid4().hex) + + def test_user_update_tenant_404(self): + raise nose.exc.SkipTest('N/A') + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.users.update, + user=self.user_foo['id'], + tenant_id=uuid.uuid4().hex) + + def test_user_update_password_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.users.update_password, + user=uuid.uuid4().hex, + password=uuid.uuid4().hex) + + def test_user_delete_404(self): + from keystoneclient import exceptions as client_exceptions + client = self.get_client(admin=True) + self.assertRaises(client_exceptions.NotFound, + client.users.delete, + user=uuid.uuid4().hex) + def test_user_list(self): client = self.get_client(admin=True) users = client.users.list() @@ -710,3 +765,6 @@ class KcEssex3TestCase(CompatTestCase, KeystoneClientTests): client.users.delete(user.id) self.assertRaises(client_exceptions.NotFound, client.users.get, user.id) + + def test_user_update_404(self): + raise nose.exc.SkipTest('N/A') |