本文整理汇总了Python中nova.api.metadata.password.handle_password函数的典型用法代码示例。如果您正苦于以下问题:Python handle_password函数的具体用法?Python handle_password怎么用?Python handle_password使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了handle_password函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _try_set_password
def _try_set_password(self, val='bar'):
request = webob.Request.blank('')
request.method = 'POST'
request.body = val
self.stubs.Set(db, 'instance_system_metadata_update',
lambda *a, **kw: None)
password.handle_password(request, self.mdinst)
开发者ID:atb990,项目名称:nova,代码行数:7,代码来源:test_metadata.py
示例2: _try_set_password
def _try_set_password(self, get_by_uuid, val='bar'):
request = webob.Request.blank('')
request.method = 'POST'
request.body = val
get_by_uuid.return_value = self.instance
with mock.patch.object(self.instance, 'save') as save:
password.handle_password(request, self.mdinst)
save.assert_called_once_with()
self.assertIn('password_0', self.instance.system_metadata)
开发者ID:apporc,项目名称:nova,代码行数:11,代码来源:test_metadata.py
示例3: _try_set_password
def _try_set_password(self, get_by_uuid, val="bar"):
request = webob.Request.blank("")
request.method = "POST"
request.body = val
get_by_uuid.return_value = self.instance
with mock.patch.object(self.instance, "save") as save:
password.handle_password(request, self.mdinst)
save.assert_called_once_with()
self.assertIn("password_0", self.instance.system_metadata)
开发者ID:linzhonghong,项目名称:nova,代码行数:11,代码来源:test_metadata.py
示例4: _try_set_password
def _try_set_password(self, val="bar"):
request = webob.Request.blank("")
request.method = "POST"
request.body = val
self.stubs.Set(db, "instance_get_by_uuid", lambda *a, **kw: {"system_metadata": []})
def fake_instance_update(context, uuid, updates):
self.assertIn("system_metadata", updates)
self.assertIn("password_0", updates["system_metadata"])
return self.instance, self.instance
self.stubs.Set(db, "instance_update_and_get_original", fake_instance_update)
password.handle_password(request, self.mdinst)
开发者ID:ewindisch,项目名称:nova,代码行数:13,代码来源:test_metadata.py
示例5: _try_set_password
def _try_set_password(self, val='bar'):
request = webob.Request.blank('')
request.method = 'POST'
request.body = val
self.stubs.Set(db, 'instance_get_by_uuid',
lambda *a, **kw: {'system_metadata': []})
def fake_instance_update(context, uuid, updates):
self.assertIn('system_metadata', updates)
self.assertIn('password_0', updates['system_metadata'])
return self.instance, self.instance
self.stubs.Set(db, 'instance_update_and_get_original',
fake_instance_update)
password.handle_password(request, self.mdinst)
开发者ID:fpatwa,项目名称:nova,代码行数:15,代码来源:test_metadata.py
示例6: test_get_password
def test_get_password(self):
request = webob.Request.blank('')
self.mdinst.password = 'foo'
result = password.handle_password(request, self.mdinst)
self.assertEqual(result, 'foo')
开发者ID:apporc,项目名称:nova,代码行数:5,代码来源:test_metadata.py
示例7: test_get_password
def test_get_password(self):
request = webob.Request.blank("")
self.mdinst.password = "foo"
result = password.handle_password(request, self.mdinst)
self.assertEqual(result, "foo")
开发者ID:linzhonghong,项目名称:nova,代码行数:5,代码来源:test_metadata.py
示例8: _try_set_password
def _try_set_password(self, val="bar"):
request = webob.Request.blank("")
request.method = "POST"
request.body = val
self.stubs.Set(db, "instance_system_metadata_update", lambda *a, **kw: None)
password.handle_password(request, self.mdinst)
开发者ID:kumarcv,项目名称:nova,代码行数:6,代码来源:test_metadata.py
注:本文中的nova.api.metadata.password.handle_password函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论