本文整理汇总了Python中pyrax.clouddatabases.CloudDatabaseUser类的典型用法代码示例。如果您正苦于以下问题:Python CloudDatabaseUser类的具体用法?Python CloudDatabaseUser怎么用?Python CloudDatabaseUser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CloudDatabaseUser类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_user_list_user_access
def test_user_list_user_access(self):
inst = self.instance
mgr = inst.manager
user = CloudDatabaseUser(mgr, info={"name": "fake"})
mgr.list_user_access = Mock()
user.list_user_access()
mgr.list_user_access.assert_called_once_with(user)
示例2: test_user_change_password
def test_user_change_password(self):
inst = self.instance
mgr = inst.manager
password = utils.random_unicode()
user = CloudDatabaseUser(mgr, info={"name": "fake"})
mgr.change_user_password = Mock()
user.change_password(password)
mgr.change_user_password.assert_called_once_with(user, password)
示例3: test_delete_user_direct
def test_delete_user_direct(self):
inst = self.instance
mgr = inst.manager
name = utils.random_unicode()
user = CloudDatabaseUser(mgr, info={"name": name})
mgr.delete = Mock()
user.delete()
mgr.delete.assert_called_once_with(name)
示例4: test_user_revoke_user_access
def test_user_revoke_user_access(self):
inst = self.instance
mgr = inst.manager
user = CloudDatabaseUser(mgr, info={"name": "fake"})
db_names = utils.random_unicode()
strict = utils.random_unicode()
mgr.revoke_user_access = Mock()
user.revoke_user_access(db_names, strict=strict)
mgr.revoke_user_access.assert_called_once_with(user, db_names,
strict=strict)
示例5: test_user_update
def test_user_update(self):
inst = self.instance
mgr = inst.manager
name = utils.random_unicode()
password = utils.random_unicode()
host = utils.random_unicode()
user = CloudDatabaseUser(mgr, info={"name": "fake"})
mgr.update = Mock()
user.update(name=name, password=password, host=host)
mgr.update.assert_called_once_with(user, name=name, password=password,
host=host)