def serf(self): return client.SerfClient()
def test_rpc_auth(self, mock_serf_connection_class): mock_serf_connection = mock.MagicMock() mock_serf_connection_class.return_value = mock_serf_connection serf = client.SerfClient(rpc_auth='secret') assert serf.connection is not None mock_serf_connection.auth.assert_called_once_with('secret')
def serf(self): with closing(client.SerfClient()) as serf: yield serf