示例#1
0
文件: test_conf.py 项目: nyccto/mrjob
    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"],
        )
示例#2
0
    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'
                ])
示例#3
0
文件: conf_test.py 项目: gimlids/LTPM
    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'])
示例#4
0
 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'])
示例#5
0
 def test_combine_path_lists_empty(self):
     self.assertEqual(combine_path_lists(), [])
示例#6
0
文件: conf_test.py 项目: gimlids/LTPM
 def test_combine_path_lists(self):
     assert_equal(
         combine_path_lists(['~/tmp'], [], ['/dev/null', '/tmp/$USER']),
         ['/home/foo/tmp', '/dev/null', '/tmp/foo'])
示例#7
0
文件: conf_test.py 项目: gimlids/LTPM
 def test_combine_path_lists_empty(self):
     assert_equal(combine_path_lists(), [])
示例#8
0
文件: test_conf.py 项目: icio/mrjob
 def test_combine_path_lists_empty(self):
     self.assertEqual(combine_path_lists(), [])
示例#9
0
文件: test_conf.py 项目: nyccto/mrjob
 def test_combine_path_lists(self):
     self.assertEqual(
         combine_path_lists(["~/tmp"], [], ["/dev/null", "/tmp/$USER"]), ["/home/foo/tmp", "/dev/null", "/tmp/foo"]
     )
示例#10
0
文件: test_conf.py 项目: Affirm/mrjob
 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'])
示例#11
0
 def test_combine_path_lists(self):
     assert_equal(
         combine_path_lists(['~/tmp'], [], ['/dev/null', '/tmp/$USER']),
         ['/home/foo/tmp', '/dev/null', '/tmp/foo'])
示例#12
0
 def test_combine_path_lists_empty(self):
     assert_equal(combine_path_lists(), [])