Added an int-test for user-update-attributes

Added an integration test to validate that passing in no new
attributes to user-update-attributes causes an exception to
be thrown.

Change-Id: I6eba530973cc18834ed08eb91127101d9abb1210
Related-Bug: #1298760
This commit is contained in:
Peter Stachowski 2014-06-04 17:53:45 -04:00
parent 9314db40bc
commit d655a922b5
1 changed files with 17 additions and 0 deletions

View File

@ -310,6 +310,23 @@ class TestUsers(object):
assert_equal(400, self.dbaas.last_http_code)
self.dbaas.users.delete(instance_info.id, username, hostname=hostname)
@test()
def test_updateuser_nochanges(self):
# Cannot update the user without passing in at least one change
users = []
username = "testuser_nochg"
hostname = "192.168.0.1"
users.append({"name": username, "password": "password",
"host": hostname, "databases": []})
self.dbaas.users.create(instance_info.id, users)
user_new = {}
assert_raises(Exception,
self.dbaas.users.update_attributes, instance_info.id,
username, user_new, hostname)
# The last_http_code doesn't have to be checked, since the exception
# is thrown before the actual http request is executed
self.dbaas.users.delete(instance_info.id, username, hostname=hostname)
@test(depends_on=[test_create_users])
def test_hostname_ipv4_restriction(self):
# By default, user hostnames are required to be % or IPv4 addresses.