mirror of
				https://github.com/arsenetar/dupeguru.git
				synced 2025-09-11 17:58:17 +00:00 
			
		
		
		
	Fixed core_me.tests.scanner_test which was broken.
This commit is contained in:
		
							parent
							
								
									e6d4d44f15
								
							
						
					
					
						commit
						d2e2f337f6
					
				| @ -7,7 +7,9 @@ | |||||||
| # which should be included with this package. The terms are also available at  | # which should be included with this package. The terms are also available at  | ||||||
| # http://www.hardcoded.net/licenses/hs_license | # http://www.hardcoded.net/licenses/hs_license | ||||||
| 
 | 
 | ||||||
|  | from hsutil import io | ||||||
| from hsutil.path import Path | from hsutil.path import Path | ||||||
|  | from hsutil.testcase import TestCase | ||||||
| 
 | 
 | ||||||
| from core.engine import getwords | from core.engine import getwords | ||||||
| from ..scanner import * | from ..scanner import * | ||||||
| @ -22,11 +24,18 @@ class NamedObject(object): | |||||||
| 
 | 
 | ||||||
| no = NamedObject | no = NamedObject | ||||||
| 
 | 
 | ||||||
| def test_priorize_me(): | class ScannerTestFakeFiles(TestCase): | ||||||
|     # in ScannerME, bitrate goes first (right after is_ref) in priorization |     def setUp(self): | ||||||
|     s = ScannerME() |         # This is a hack to avoid invalidating all previous tests since the scanner started to test | ||||||
|     o1, o2 = no('foo'), no('foo') |         # for file existence before doing the match grouping. | ||||||
|     o1.bitrate = 1 |         self.mock(io, 'exists', lambda _: True) | ||||||
|     o2.bitrate = 2 |      | ||||||
|     [group] = s.GetDupeGroups([o1, o2]) |     def test_priorize_me(self): | ||||||
|     assert group.ref is o2 |         # in ScannerME, bitrate goes first (right after is_ref) in priorization | ||||||
|  |         s = ScannerME() | ||||||
|  |         o1, o2 = no('foo'), no('foo') | ||||||
|  |         o1.bitrate = 1 | ||||||
|  |         o2.bitrate = 2 | ||||||
|  |         [group] = s.GetDupeGroups([o1, o2]) | ||||||
|  |         assert group.ref is o2 | ||||||
|  |      | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user