mirror of
				https://github.com/arsenetar/dupeguru.git
				synced 2025-09-11 17:58:17 +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
 | 
					        app = self.app
 | 
				
			||||||
        # any other path that isn't a parent or child of the already added path
 | 
					        # any other path that isn't a parent or child of the already added path
 | 
				
			||||||
        otherpath = Path(op.dirname(__file__))
 | 
					        otherpath = Path(op.dirname(__file__))
 | 
				
			||||||
        eq_(app.add_directory(otherpath), 0)
 | 
					        app.add_directory(otherpath)
 | 
				
			||||||
        eq_(len(app.directories), 2)
 | 
					        eq_(len(app.directories), 2)
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    def test_addDirectory_already_there(self, do_setup):
 | 
					    def test_addDirectory_already_there(self, do_setup):
 | 
				
			||||||
        app = self.app
 | 
					        app = self.app
 | 
				
			||||||
        otherpath = Path(op.dirname(__file__))
 | 
					        otherpath = Path(op.dirname(__file__))
 | 
				
			||||||
        eq_(app.add_directory(otherpath), 0)
 | 
					        app.add_directory(otherpath)
 | 
				
			||||||
        eq_(app.add_directory(otherpath), 1)
 | 
					        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):
 | 
					    def test_addDirectory_does_not_exist(self, do_setup):
 | 
				
			||||||
        app = self.app
 | 
					        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):
 | 
					    def test_ignore(self, do_setup):
 | 
				
			||||||
        app = self.app
 | 
					        app = self.app
 | 
				
			||||||
 | 
				
			|||||||
@ -24,6 +24,9 @@ from ..gui.prioritize_dialog import PrioritizeDialog
 | 
				
			|||||||
class DupeGuruView:
 | 
					class DupeGuruView:
 | 
				
			||||||
    JOB = nulljob
 | 
					    JOB = nulljob
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					    def __init__(self):
 | 
				
			||||||
 | 
					        self.messages = []
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    def start_job(self, jobid, func, args=()):
 | 
					    def start_job(self, jobid, func, args=()):
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            func(self.JOB, *args)
 | 
					            func(self.JOB, *args)
 | 
				
			||||||
@ -37,7 +40,7 @@ class DupeGuruView:
 | 
				
			|||||||
        pass
 | 
					        pass
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    def show_message(self, msg):
 | 
					    def show_message(self, msg):
 | 
				
			||||||
        pass
 | 
					        self.messages.append(msg)
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    def ask_yes_no(self, prompt):
 | 
					    def ask_yes_no(self, prompt):
 | 
				
			||||||
        return True # always answer yes
 | 
					        return True # always answer yes
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user