def test_no_env(argv, expected): """Test outside of any supported CI env. :param iter argv: Mock sys.argv. :param dict expected: Expected return value of get_arguments(). """ environ = dict(PATH='.') actual = get_arguments(['download'] + argv, environ) assert actual == expected
def test_ci(argv, expected, kind, ci): """Test CI env.""" environ = ci[kind]['environ'] expected = expected.copy() # Apply expected updates when environment variables are not being overridden. if '-c' not in argv: expected.update(ci[kind]['expected']) actual = get_arguments(['download'] + argv, environ) assert actual == expected
def test_ci(argv, expected, kind, ci): """Test CI env. :param iter argv: Mock sys.argv. :param dict expected: Expected return value of get_arguments(). :param str kind: Type of change triggering a Travis CI build. :param dict ci: Contains environment variables and additional expected values. """ environ = ci[kind]['environ'] expected = expected.copy() # Apply expected updates when environment variables are not being overridden. if '-c' not in argv: expected.update(ci[kind]['expected']) actual = get_arguments(['download'] + argv, environ) assert actual == expected
def test_no_env(argv, expected): """Test outside of any supported CI env.""" environ = dict(PATH='.') actual = get_arguments(['download'] + argv, environ) assert actual == expected