def test_special_paths(mock_projects): pc = PilotClient() pc.project.current = 'foo-project' assert pc.get_path('///') == '/foo_folder' assert pc.get_path('.') == '/foo_folder' assert pc.get_path('..') == '/foo_folder' assert pc.get_path('/foo/bar/baz.txt') == '/foo_folder/foo/bar/baz.txt'
def test_get_test_path(): pc = PilotClient() path = pc.get_path('dataframe.dat', 'my_folder', test=True) pieces = path.split('/') assert 'my_folder' in pieces assert 'dataframe.dat' in pieces assert pc.TESTING_DIR in path
def test_get_path(mock_projects): pc = PilotClient() pc.project.current = 'foo-project' assert pc.get_path('folder/file.txt') == '/foo_folder/folder/file.txt' path = pc.get_path('folder/file.txt', project='foo-project-test') assert path == '/foo_test_folder/folder/file.txt'