def test_globbing(self): foo_path = os.path.join(self.tmp_dir, "foo") bar_path = os.path.join(self.tmp_dir, "bar") open(foo_path, "w").close() open(bar_path, "w").close() # make sure that paths that don't match anything on the local # filesystem are still preserved. self.assertEqual( combine_path_lists( [os.path.join(self.tmp_dir, "*"), foo_path], [os.path.join(self.tmp_dir, "q*"), "s3://walrus/foo"], None ), [bar_path, foo_path, foo_path, os.path.join(self.tmp_dir, "q*"), "s3://walrus/foo"], )
def test_globbing(self): foo_path = os.path.join(self.tmp_dir, 'foo') bar_path = os.path.join(self.tmp_dir, 'bar') open(foo_path, 'w').close() open(bar_path, 'w').close() # make sure that paths that don't match anything on the local # filesystem are still preserved. self.assertEqual( combine_path_lists( [os.path.join(self.tmp_dir, '*'), foo_path], [os.path.join(self.tmp_dir, 'q*'), 's3://walrus/foo'], None), [ bar_path, foo_path, foo_path, os.path.join(self.tmp_dir, 'q*'), 's3://walrus/foo' ])
def test_globbing(self): foo_path = os.path.join(self.tmp_dir, 'foo') bar_path = os.path.join(self.tmp_dir, 'bar') open(foo_path, 'w').close() open(bar_path, 'w').close() # make sure that paths that don't match anything on the local # filesystem are still preserved. assert_equal( combine_path_lists([os.path.join(self.tmp_dir, '*'), foo_path], [os.path.join(self.tmp_dir, 'q*'), 's3://walrus/foo'], None), [bar_path, foo_path, foo_path, os.path.join(self.tmp_dir, 'q*'), 's3://walrus/foo'])
def test_combine_path_lists_on_strings(self): self.assertEqual( combine_path_lists('~/tmp', [], ['/dev/null', '/tmp/$USER']), ['/home/foo/tmp', '/dev/null', '/tmp/foo'])
def test_combine_path_lists_empty(self): self.assertEqual(combine_path_lists(), [])
def test_combine_path_lists(self): assert_equal( combine_path_lists(['~/tmp'], [], ['/dev/null', '/tmp/$USER']), ['/home/foo/tmp', '/dev/null', '/tmp/foo'])
def test_combine_path_lists_empty(self): assert_equal(combine_path_lists(), [])
def test_combine_path_lists(self): self.assertEqual( combine_path_lists(["~/tmp"], [], ["/dev/null", "/tmp/$USER"]), ["/home/foo/tmp", "/dev/null", "/tmp/foo"] )