Fixed core_me.scanner_test

This commit is contained in:
Virgil Dupras 2012-05-29 17:05:39 -04:00
parent cbf2ab82ce
commit 2128d1787a
1 changed files with 2 additions and 11 deletions

View File

@ -11,18 +11,9 @@ from hscommon import io
from hscommon.path import Path
from core.engine import getwords
from core.tests.scanner_test import NamedObject, no
from ..scanner import *
class NamedObject:
def __init__(self, name="foobar", size=1):
self.name = name
self.size = size
self.path = Path('')
self.words = getwords(name)
no = NamedObject
def pytest_funcarg__fake_fileexists(request):
# This is a hack to avoid invalidating all previous tests since the scanner started to test
# for file existence before doing the match grouping.
@ -32,7 +23,7 @@ def pytest_funcarg__fake_fileexists(request):
def test_priorize_me(fake_fileexists):
# in ScannerME, bitrate goes first (right after is_ref) in priorization
s = ScannerME()
o1, o2 = no('foo'), no('foo')
o1, o2 = no('foo', path='p1'), no('foo', path='p2')
o1.bitrate = 1
o2.bitrate = 2
[group] = s.get_dupe_groups([o1, o2])