def test_deprecated_env_options(self): val = uuid.uuid4().hex with mock.patch.dict('os.environ', {'OS_TEST_OTHER': val}): cli._register_plugin_argparse_arguments(self.p, TesterLoader()) opts = self.p.parse_args([]) self.assertEqual(val, opts.os_test_opt)
def test_deprecated_multi_cli_options(self): cli._register_plugin_argparse_arguments(self.p, TesterLoader()) val1 = uuid.uuid4().hex val2 = uuid.uuid4().hex # argarse rules say that the last specified wins. opts = self.p.parse_args( ['--os-test-other', val2, '--os-test-opt', val1]) self.assertEqual(val1, opts.os_test_opt)
def test_deprecated_multi_cli_options(self): cli._register_plugin_argparse_arguments(self.p, TesterLoader()) val1 = uuid.uuid4().hex val2 = uuid.uuid4().hex # argarse rules say that the last specified wins. opts = self.p.parse_args(['--os-test-other', val2, '--os-test-opt', val1]) self.assertEqual(val1, opts.os_test_opt)
def test_deprecated_cli_options(self): cli._register_plugin_argparse_arguments(self.p, TesterLoader()) val = uuid.uuid4().hex opts = self.p.parse_args(['--os-test-other', val]) self.assertEqual(val, opts.os_test_opt)