def test_get_locations_with_very_long_path(self): longpath = ( 'longpath' '/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' '/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' '/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' '/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' ) test_loc = extract_test_loc('test_util/longpath.zip') result = list(util.get_locations(test_loc)) assert any(longpath in r for r in result)
def test_get_locations_with_very_long_path(self): longpath = ( u'longpath' u'/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' u'/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' u'/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' u'/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1/longpath1' ) test_loc = extract_test_loc('longpath.zip') result = list(util.get_locations(test_loc)) assert any(longpath in r for r in result)
def test_get_locations(self): test_dir = get_test_loc('locations') expected = sorted([ 'locations/file with_spaces', 'locations/file1', 'locations/file2', 'locations/dir1/file2', 'locations/dir1/dir2/file1', 'locations/dir2/file1' ]) result = sorted(util.get_locations(test_dir)) for i, res in enumerate(result): expect = expected[i] assert res.endswith(expect)
def test_get_locations(self): test_dir = get_test_loc('test_util/about_locations') expected = sorted([ 'file with_spaces.ABOUT', 'file1', 'file2', 'dir1/file2', 'dir1/file2.aBout', 'dir1/dir2/file1.about', 'dir2/file1']) result = sorted(util.get_locations(test_dir)) result = [l.partition('/about_locations/')[-1] for l in result] assert expected == result
def test_get_locations(self): test_dir = get_test_loc('locations') expected = sorted([ 'locations/file with_spaces', 'locations/file1', 'locations/file2', 'locations/dir1/file2', 'locations/dir1/dir2/file1', 'locations/dir2/file1']) result = sorted(util.get_locations(test_dir)) for i, res in enumerate(result): expect = expected[i] assert res.endswith(expect)
def test_get_locations_can_yield_a_single_file(self): test_file = get_test_loc('test_util/about_locations/file with_spaces.ABOUT') result = list(util.get_locations(test_file)) assert 1 == len(result)