コード例 #1
0
ファイル: test_trashdir.py プロジェクト: ahua/python
class TestTrashDir_finding_orphans:
    def test(self):
        self.fs.create_fake_file('/info/foo.trashinfo')

        self.find_orphan()

        assert_equals([], self.orphan_found)

    def test2(self):
        self.fs.create_fake_file('/files/foo')

        self.find_orphan()

        assert_equals(['/files/foo'], self.orphan_found)

    def setUp(self):
        self.orphan_found=[]
        self.fs = FakeFileSystem()
        self.trashdir=TrashDir(self.fs, '/', None)

    def find_orphan(self):
        self.trashdir.each_orphan(self.orphan_found.append)
コード例 #2
0
ファイル: test_trashdir.py プロジェクト: timgates42/trash-cli
class TestTrashDir_finding_orphans(unittest.TestCase):
    def test(self):
        self.fs.create_fake_file('/info/foo.trashinfo')

        self.find_orphan()

        assert [] == self.orphan_found

    def test2(self):
        self.fs.create_fake_file('/files/foo')

        self.find_orphan()

        assert ['/files/foo'] == self.orphan_found

    def setUp(self):
        self.orphan_found = []
        self.fs = FakeFileSystem()
        self.trashdir = TrashDir(self.fs)
        self.trashdir.open('/', None)

    def find_orphan(self):
        self.trashdir.each_orphan(self.orphan_found.append)