File: test_trash_dir_reader.py

package info (click to toggle)
trash-cli 0.24.5.26-0.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,972 kB
  • sloc: python: 9,789; sh: 121; makefile: 11
file content (26 lines) | stat: -rw-r--r-- 677 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (C) 2011 Andrea Francia Trivolzio(PV) Italy
import unittest

from tests.support.fakes.fake_file_system import FakeFileSystem

from trashcli.lib.trash_dir_reader import TrashDirReader


class TestTrashDirReader(unittest.TestCase):
    def setUp(self):
        self.fs = FakeFileSystem()
        self.trash_dir = TrashDirReader(self.fs)

    def test(self):
        self.fs.create_fake_file('/info/foo.trashinfo')

        result = list(self.trash_dir.list_orphans('/'))

        assert [] == result

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

        result = list(self.trash_dir.list_orphans('/'))

        assert ['/files/foo'] == result