def test_jump_host_args(): cli = Cli() args = ["--server", "172.16.180.10", "--port", "22", "--username", "vagrant", "--password", "vagrant", "--jump-server", "172.16.180.20", "--jump-username", "vagrant", "--jump-password", "vagrant"] arguments = cli.parse_args(args) cli.configure_args(arguments) args = ["--server", "172.16.180.10", "--port", "22", "--username", "vagrant", "--password", "vagrant", "--jump-server", "172.16.180.20", "--jump-username", "vagrant", "--jump-password", "vagrant", "--jump-port", "22"] arguments = cli.parse_args(args) cli.configure_args(arguments)
def test_jump_host_args(): cli = Cli() args = [ "--server", "172.16.180.10", "--port", "22", "--username", "vagrant", "--password", "vagrant", "--jump-server", "172.16.180.20", "--jump-username", "vagrant", "--jump-password", "vagrant" ] arguments = cli.parse_args(args) cli.configure_args(arguments) args = [ "--server", "172.16.180.10", "--port", "22", "--username", "vagrant", "--password", "vagrant", "--jump-server", "172.16.180.20", "--jump-username", "vagrant", "--jump-password", "vagrant", "--jump-port", "22" ] arguments = cli.parse_args(args) cli.configure_args(arguments)
def test_configure_args(): cli = Cli() args = ["-c", "tests/files/validate_passing.yml"] arguments = cli.parse_args(args) cli.configure_args(arguments) args = ["--server", "tests/files/validate_passing.yml", "--repository-url", "https://www.example.com/repo"] arguments = cli.parse_args(args) cli.configure_args(arguments) args = ["-c", "tests/files/yml_failing.yml"] arguments = cli.parse_args(args) with pytest.raises(YAMLError): cli.configure_args(arguments) args = ["-c", "tests/files/validate_failing_aws.yml"] arguments = cli.parse_args(args) with pytest.raises(InvalidConfigurationError): cli.configure_args(arguments)
def test_configure_args(): cli = Cli() args = ["-c", "tests/files/validate_passing.yml"] arguments = cli.parse_args(args) cli.configure_args(arguments) args = [ "--server", "tests/files/validate_passing.yml", "--repository-url", "https://www.example.com/repo" ] arguments = cli.parse_args(args) cli.configure_args(arguments) args = ["-c", "tests/files/yml_failing.yml"] arguments = cli.parse_args(args) with pytest.raises(YAMLError): cli.configure_args(arguments) args = ["-c", "tests/files/validate_failing_aws.yml"] arguments = cli.parse_args(args) with pytest.raises(InvalidConfigurationError): cli.configure_args(arguments)
def test_configure_args(): cli = Cli() args = ["-c", "tests/files/validate_passing.yml"] arguments = cli.parse_args(args) cli.configure_args(arguments) args = ["-c", "tests/files/yml_failing.yml"] arguments = cli.parse_args(args) with pytest.raises(YAMLError): cli.configure_args(arguments) args = ["-c", "tests/files/validate_failing_aws.yml"] arguments = cli.parse_args(args) with pytest.raises(InvalidConfigurationError): cli.configure_args(arguments)
def test_environment_var_override(): cli = Cli() #TODO: set environment variable here os.environ['LIME_REPOSITORY'] = 'enabled' arguments = cli.parse_args(['-c', 'tests/files/validate_passing.yml']) cli.configure_args(arguments)