forked from andreafrancia/trash-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_empty.py
25 lines (18 loc) · 877 Bytes
/
test_empty.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from trashcli.empty import EmptyCmd
from mock import Mock, call
from nose.tools import assert_equals
class TestTrashEmptyCmd:
def setUp(self):
self.empty_all_trashdirs = Mock()
self.empty_trashdir = Mock()
self.cmd = EmptyCmd(None, None, None, None, None, None, None, None, None)
self.cmd.empty_all_trashdirs = self.empty_all_trashdirs
self.cmd.empty_trashdir = self.empty_trashdir
def test_default_behaviour_is_emtpy_all_trashdirs(self):
self.cmd.run('trash-empty')
assert_equals([call()], self.empty_all_trashdirs.mock_calls)
assert_equals([], self.empty_trashdir.mock_calls)
def test(self):
self.cmd.run('trash-empty', '--trash-dir', 'specific')
assert_equals([], self.empty_all_trashdirs.mock_calls)
assert_equals([call('specific')], self.empty_trashdir.mock_calls)