mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24:36 +00:00
Fixed add_directory() test which were broken.
This commit is contained in:
parent
3441e51c0e
commit
91f3a59523
@ -330,18 +330,22 @@ class TestCaseDupeGuruWithResults:
|
||||
app = self.app
|
||||
# any other path that isn't a parent or child of the already added path
|
||||
otherpath = Path(op.dirname(__file__))
|
||||
eq_(app.add_directory(otherpath), 0)
|
||||
app.add_directory(otherpath)
|
||||
eq_(len(app.directories), 2)
|
||||
|
||||
def test_addDirectory_already_there(self, do_setup):
|
||||
app = self.app
|
||||
otherpath = Path(op.dirname(__file__))
|
||||
eq_(app.add_directory(otherpath), 0)
|
||||
eq_(app.add_directory(otherpath), 1)
|
||||
app.add_directory(otherpath)
|
||||
app.add_directory(otherpath)
|
||||
eq_(len(app.view.messages), 1)
|
||||
assert "already" in app.view.messages[0]
|
||||
|
||||
def test_addDirectory_does_not_exist(self, do_setup):
|
||||
app = self.app
|
||||
eq_(2,app.add_directory('/does_not_exist'))
|
||||
app.add_directory('/does_not_exist')
|
||||
eq_(len(app.view.messages), 1)
|
||||
assert "exist" in app.view.messages[0]
|
||||
|
||||
def test_ignore(self, do_setup):
|
||||
app = self.app
|
||||
|
@ -24,6 +24,9 @@ from ..gui.prioritize_dialog import PrioritizeDialog
|
||||
class DupeGuruView:
|
||||
JOB = nulljob
|
||||
|
||||
def __init__(self):
|
||||
self.messages = []
|
||||
|
||||
def start_job(self, jobid, func, args=()):
|
||||
try:
|
||||
func(self.JOB, *args)
|
||||
@ -37,7 +40,7 @@ class DupeGuruView:
|
||||
pass
|
||||
|
||||
def show_message(self, msg):
|
||||
pass
|
||||
self.messages.append(msg)
|
||||
|
||||
def ask_yes_no(self, prompt):
|
||||
return True # always answer yes
|
||||
|
Loading…
x
Reference in New Issue
Block a user