def setUp(self): super(AsyncBackendTests, self).setUp() self.backend = StubBackend() self.asyncBackend = AsyncBackend(self.backend) syspurpose_patch = patch('subscription_manager.syspurposelib.SyncedStore') self.mock_sp_store = syspurpose_patch.start() self.mock_sp_store, self.mock_sp_store_contents = set_up_mock_sp_store(self.mock_sp_store) self.addCleanup(syspurpose_patch.stop)
def __init__(self): self.parent_window = Mock() self.backend = StubBackend() self.async_backend = Mock() self.reg_info = Mock() self.expected_facts = {'fact1': 'one', 'fact2': 'two', 'system': '', 'system.uuid': 'MOCKUUID'} self.facts = StubFacts(fact_dict=self.expected_facts)
def setUp(self): super(RegisterWidgetTests, self).setUp() self.exc_infos = [] self.excs = [] self.backend = StubBackend() expected_facts = {'fact1': 'one', 'fact2': 'two', 'system': '', 'system.uuid': 'MOCKUUID'} self.facts = StubFacts(fact_dict=expected_facts) self.reg_info = RegisterInfo() self.rs = RegisterWidget(backend=self.backend, reg_info=self.reg_info) self.rs._screens[CHOOSE_SERVER_PAGE] = Mock() self.rs._screens[CHOOSE_SERVER_PAGE].index = 0 self.rs._screens[CHOOSE_SERVER_PAGE].screens_index = 0 self.rs._screens[CHOOSE_SERVER_PAGE].button_label = "Dummy" self.rs._screens[CHOOSE_SERVER_PAGE].apply.return_value = CREDENTIALS_PAGE
def setUp(self): super(AsyncBackendTests, self).setUp() self.backend = StubBackend() self.asyncBackend = AsyncBackend(self.backend)
def mock_parent(): parent = Mock() backend = StubBackend() parent.backend = backend parent.async_backend = Mock()