예제 #1
0
    def test_list_file_empty_dirs(self):
        l = base.list_tree(self.p11, create_empty_dirs=True)

        self.assertEquals(
            l,
            [self.p11]
        )
예제 #2
0
    def test_list_file_exclude_paths(self):
        l = base.list_tree(self.p11, exclude_paths=[self.p1])

        self.assertEquals(
            l,
            []
        )
예제 #3
0
    def test_list_file(self):
        l = base.list_tree(self.p11)

        self.assertEquals(
            l,
            [self.p11]
        )
예제 #4
0
    def test_list_tree_exclude_paths(self):
        l = base.list_tree(self.BASEDIRNAME, exclude_paths=[self.p1])

        self.assertEquals(
            set(l),
            set([
                self.p21,
                self.p22,
            ])
        )
예제 #5
0
    def test_list_tree(self):
        l = base.list_tree(self.BASEDIRNAME)

        self.assertEquals(
            set(l),
            set([
                self.p11,
                self.p21,
                self.p22,
            ]))
예제 #6
0
    def test_list_tree_empty_dirs_exclude_paths(self):
        l = base.list_tree(self.BASEDIRNAME, exclude_paths=[self.p1], create_empty_dirs=True)

        self.assertEquals(
            set(l),
            set([
                self.p21,
                self.p22,
                os.path.join(self.BASEDIRNAME, '.empty'),
                os.path.join(self.p2, '.empty'),
                os.path.join(self.p3, '.empty'),
            ])
        )
예제 #7
0
 def test_list_nonexistant(self):
     l = base.list_tree('/nonexistent')
     self.assertEquals(l, [])