Example #1
0
def test_parse_paths(monkeypatch):
    """Test the parse_paths function"""
    monkeypatch.chdir(os.path.dirname(__file__))
    cmdline_parser = CmdlineParser()
    assert cmdline_parser._parse_paths(__file__) == os.path.abspath(__file__)

    values = ['test_resolve_config.py', 'test', 'nada', __file__]
    parsed_values = cmdline_parser._parse_paths(values)
    assert parsed_values[0] == os.path.abspath('test_resolve_config.py')
    assert parsed_values[1] == 'test'
    assert parsed_values[2] == 'nada'
    assert parsed_values[3] == os.path.abspath(__file__)
Example #2
0
def test_parse_paths(monkeypatch):
    """Test the parse_paths function"""
    monkeypatch.chdir(os.path.dirname(__file__))
    cmdline_parser = CmdlineParser()
    assert cmdline_parser._parse_paths(__file__) == os.path.abspath(__file__)

    values = ["test_resolve_config.py", "test", "nada", __file__]
    parsed_values = cmdline_parser._parse_paths(values)
    assert parsed_values[0] == os.path.abspath("test_resolve_config.py")
    assert parsed_values[1] == "test"
    assert parsed_values[2] == "nada"
    assert parsed_values[3] == os.path.abspath(__file__)