def setUp(self):
spy = unittest.mock.Mock()
class MyClient(Client):
attr_name = 'my_clients'
@staticmethod
def validator():
return {
voluptuous.Required('foo'): int,
voluptuous.Optional('bar', default='def bar'): str
}
def __init__(self, **kwargs):
spy(kwargs)
def close(self):
spy('close')
self.spy = spy
MetaServerTestState.bind_class_client(MyClient)
self.addCleanup(lambda: MetaServerTestState.forget_client(MyClient))
评论列表
文章目录