Python click 模块,testing() 实例源码

我们从Python开源项目中,提取了以下16个代码示例,用于说明如何使用click.testing()

项目:filegardener    作者:smorin    | 项目源码 | 文件源码
def test_importclick(self):
        """ testing that importing a core package works """
        import click
项目:filegardener    作者:smorin    | 项目源码 | 文件源码
def file_dir_identicaldirs(self, request, tmpdir_factory):
        # tmpdir is a Reference: http://py.readthedocs.io/en/latest/path.html py.path.local object
        tmpdir = tmpdir_factory.mktemp('identicaldirs', numbered=True)
        def fin():
            print ("cleanup testing")
            # TODO: figure out how to access results to not to remove on failure
            # Reference: https://github.com/pytest-dev/pytest/blob/ffb583ae9140bfa14b28ff44245ec0b16ad760a7/doc/en/example/simple.rst
            tmpdir.remove(rec=1) # remove the directory if the test passes 
        request.addfinalizer(fin)
        return tmpdir
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        context.GLOBAL.dns_domain = 'xxx.com'
        self.module = admin_show_cli
        self.runner = click.testing.CliRunner()
        self.cli = self.module.init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        context.GLOBAL.dns_domain = 'xxx.com'
        self.module = scheduler_cli
        self.runner = click.testing.CliRunner()
        self.cli = self.module.init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        context.GLOBAL.dns_domain = 'xxx.com'
        self.module = blackout_cli
        self.runner = click.testing.CliRunner()
        self.cli = self.module.init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        context.GLOBAL.dns_domain = 'xxx.com'
        self.module = configure_cli
        self.runner = click.testing.CliRunner()
        self.cli = self.module.init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        context.GLOBAL.dns_domain = 'xxx.com'
        self.module = discovery_cli
        self.runner = click.testing.CliRunner()
        self.cli = self.module.init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        context.GLOBAL.dns_domain = 'xxx.com'
        self.module = zk2fs_sproc
        self.runner = click.testing.CliRunner()
        self.cli = self.module.init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        """Setup common test variables"""
        self.runner = click.testing.CliRunner()
        self.cli = plugin_manager.load('treadmill.cli', 'run').init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        """Setup common test variables"""
        self.runner = click.testing.CliRunner()
        self.cli = plugin_manager.load('treadmill.cli', 'show').init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        """Setup common test variables"""
        self.runner = click.testing.CliRunner()
        self.cli = plugin_manager.load('treadmill.cli',
                                       'configure').init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        """Setup common test variables"""
        self.runner = click.testing.CliRunner()
        self.alloc_cli = plugin_manager.load('treadmill.cli',
                                             'allocation').init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        """Setup common test variables"""
        self.runner = click.testing.CliRunner()
        self.log_mod = plugin_manager.load('treadmill.cli', 'logs')
        self.log_cli = self.log_mod.init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        """Setup common test variables"""
        self.runner = click.testing.CliRunner()
        self.install_cli = importlib.import_module(
            'treadmill.cli.admin.install').init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        self.patched = mock.patch(
            'treadmill.infra.utils.cli_callbacks.pkg_resources.resource_string',  # noqa
            mock.Mock(return_value=b'0.1.0')
        )
        self.patched.start()

        connection.Connection.context.region_name = 'foobar'
        self.vpc_id_mock = 'vpc-123'
        self.vpc_name = 'vpc-name'
        self.runner = click.testing.CliRunner()
        self.configure_cli = importlib.import_module(
            'treadmill.cli.admin.cloud').init()
项目:treadmill    作者:Morgan-Stanley    | 项目源码 | 文件源码
def setUp(self):
        self.vpc_name = 'IntegrationTest-' + str(time.time())
        self.runner = click.testing.CliRunner()
        self.configure_cli = importlib.import_module(
            'treadmill.cli.cloud').init()