tests: Extract some common test utils to tests/__init__.py

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 8 years ago
parent 61bdee0fa7
commit 1fcccea83f

@ -0,0 +1,11 @@
TEST_HINTER = 'test-hinter'
HINTS_ALL = ('ALL')
DEFAULT_URGENCY = 'medium'
class MockObject(object):
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)

@ -6,10 +6,9 @@ from britney2.excuse import Excuse
from britney2.hints import HintParser from britney2.hints import HintParser
from britney2.policies.policy import AgePolicy, RCBugPolicy, PiupartsPolicy, PolicyVerdict from britney2.policies.policy import AgePolicy, RCBugPolicy, PiupartsPolicy, PolicyVerdict
from . import MockObject, TEST_HINTER, HINTS_ALL, DEFAULT_URGENCY
POLICY_DATA_BASE_DIR = os.path.join(os.path.dirname(__file__), 'policy-test-data') POLICY_DATA_BASE_DIR = os.path.join(os.path.dirname(__file__), 'policy-test-data')
TEST_HINTER = 'test-hinter'
HINTS_ALL = ('ALL')
DEFAULT_URGENCY = 'medium'
def initialize_policy(test_name, policy_class, *args, **kwargs): def initialize_policy(test_name, policy_class, *args, **kwargs):
@ -52,13 +51,6 @@ def create_policy_objects(source_name, target_version, source_version):
) )
class MockObject(object):
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
class TestRCBugsPolicy(unittest.TestCase): class TestRCBugsPolicy(unittest.TestCase):
def test_no_bugs(self): def test_no_bugs(self):

Loading…
Cancel
Save