Example #1
0
 def __init__(self):
     self.parent_window = Mock()
     self.backend = StubBackend()
     self.async = 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):
        self.backend = StubBackend()
        self.consumer = Mock()
        expected_facts = {
            'fact1': 'one',
            'fact2': 'two',
            'system': '',
            'system.uuid': 'MOCKUUID'
        }
        self.facts = StubFacts(fact_dict=expected_facts)

        self.rs = RegisterScreen(self.backend, self.consumer, self.facts)
Example #3
0
    def setUp(self):
        self.uep = StubUEP
        self.backend = StubBackend()
        self.consumer = Mock()
        self.facts = StubFacts({})

        self.cert1 = StubEntitlementCertificate(
            StubProduct('product2'),
            start_date=datetime.datetime(2010, 1, 1),
            end_date=datetime.datetime(2060, 1, 1),
            quantity="10",
            stacking_id=None)

        self.cert_dir = StubCertificateDirectory([self.cert1])
Example #4
0
    def setUp(self):
        super(RegisterScreenTests, self).setUp()
        self.backend = StubBackend()
        expected_facts = {
            'fact1': 'one',
            'fact2': 'two',
            'system': '',
            'system.uuid': 'MOCKUUID'
        }
        self.facts = StubFacts(fact_dict=expected_facts)

        self.rs = RegisterScreen(self.backend, self.facts)

        self.rs._screens[CHOOSE_SERVER_PAGE] = Mock()
        self.rs._screens[CHOOSE_SERVER_PAGE].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(MySubscriptionsTabTest, self).setUp()
        self.uep = StubUEP
        self.backend = StubBackend()

        self.cert1 = StubEntitlementCertificate(
            StubProduct('product2'),
            start_date=datetime.datetime(2010, 1, 1),
            end_date=datetime.datetime(2060, 1, 1),
            quantity="10", ent_id='prod2')
        self.cert2 = StubEntitlementCertificate(
            StubProduct('product3'),
            start_date=datetime.datetime(2010, 1, 1),
            end_date=datetime.datetime(2060, 1, 1),
            quantity="10", ent_id='prod3')

        self.cert_dir = StubCertificateDirectory([self.cert1, self.cert2])
        self.my_subs_tab = MySubscriptionsTab(self.backend,
                                              None,
                                              self.cert_dir,
                                              StubProductDirectory([]))
    def setUp(self):

        expected_facts = {
            'fact1': 'one',
            'fact2': 'two',
            'system': 'Unknown',
            'system.uuid': 'MOCKUUID'
        }

        self.expected_facts = expected_facts
        self.stub_facts = StubFacts(expected_facts)

        self.backend = StubBackend()

        id_mock = Mock()
        id_mock.name = 'system'
        id_mock.uuid = 'Random UUID'
        id_mock.exists_and_valid = Mock(return_value=True)
        provide(IDENTITY, id_mock)

        sys.stderr = MockStderr
        sys.stdout = MockStdout
Example #7
0
 def setUp(self):
     super(ChooseServerScreenTests, self).setUp()
     self.backend = StubBackend()
     self.parent = Mock()
     self.screen = ChooseServerScreen(self.backend, self.parent)
Example #8
0
 def setUp(self):
     super(ActivationKeyScreenTests, self).setUp()
     self.backend = StubBackend()
     self.parent = Mock()
     self.screen = ActivationKeyScreen(self.backend, self.parent)
Example #9
0
    def setUp(self):
        super(CredentialsScreenTests, self).setUp()
        self.backend = StubBackend()
        self.parent = Mock()

        self.screen = CredentialsScreen(self.backend, self.parent)
    def setUp(self):
        self.backend = StubBackend()
        self.parent = Mock()

        self.screen = CredentialsScreen(self.backend, self.parent)
Example #11
0
 def setUp(self):
     super(AsyncBackendTests, self).setUp()
     self.backend = StubBackend()
     self.asyncBackend = AsyncBackend(self.backend)
Example #12
0
def mock_parent():
    parent = Mock()
    backend = StubBackend()
    parent.backend = backend
    parent.async = Mock()