Merge "Added an int-test for user-update-attributes"

This commit is contained in:
Jenkins 2014-06-11 18:59:42 +00:00 committed by Gerrit Code Review
commit 77575abfcd

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.