class AsyncBackendTests(SubManFixture):
    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 test_auto_system_complete(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'valid'
        self.backend.cp_provider.get_consumer_auth_cp().getServiceLevelList = Mock(return_value=[])
        self.assertRaises(AllProductsCoveredException, self.asyncBackend._find_suitable_subscriptions, '12345')

    def test_auto_system_partial(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cp_provider.get_consumer_auth_cp().dryRunBind = Mock(return_value=[])
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'partial'
        self.backend.cp_provider.get_consumer_auth_cp().getServiceLevelList = Mock(return_value=[])
        self.asyncBackend._find_suitable_subscriptions('12345')
Beispiel #2
0
class AsyncBackendTests(SubManFixture):
    def setUp(self):
        super(AsyncBackendTests, self).setUp()
        self.backend = StubBackend()
        self.asyncBackend = AsyncBackend(self.backend)

    def test_auto_system_complete(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'valid'
        self.backend.cp_provider.get_consumer_auth_cp(
        ).getServiceLevelList = Mock(return_value=[])
        self.assertRaises(AllProductsCoveredException,
                          self.asyncBackend._find_suitable_service_levels,
                          '12345')

    def test_auto_system_partial(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'partial'
        self.backend.cp_provider.get_consumer_auth_cp(
        ).getServiceLevelList = Mock(return_value=[])
        self.asyncBackend._find_suitable_service_levels('12345')
Beispiel #3
0
class AsyncBackendTests(SubManFixture):
    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 test_auto_system_complete(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'valid'
        self.backend.cp_provider.get_consumer_auth_cp().getServiceLevelList = Mock(return_value=[])
        self.assertRaises(AllProductsCoveredException, self.asyncBackend._find_suitable_service_levels, '12345')

    def test_auto_system_partial(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'partial'
        self.backend.cp_provider.get_consumer_auth_cp().getServiceLevelList = Mock(return_value=[])
        self.asyncBackend._find_suitable_service_levels('12345')
class AsyncBackendTests(SubManFixture):
    def setUp(self):
        super(AsyncBackendTests, self).setUp()
        self.backend = StubBackend()
        self.asyncBackend = AsyncBackend(self.backend)

    def test_auto_system_complete(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'valid'
        self.backend.cp_provider.get_consumer_auth_cp().getServiceLevelList = Mock(return_value=[])
        self.assertRaises(AllProductsCoveredException, self.asyncBackend._find_suitable_service_levels, '12345')

    def test_auto_system_partial(self):
        self.backend.cp_provider.get_consumer_auth_cp().getConsumer = \
            Mock(return_value={"serviceLevel": "", "owner": {"key": "admin"}})
        self.backend.cs.valid_products = ['RH001', 'RH002']
        self.backend.cs.installed_products = ['RH001', 'RH002']
        self.backend.cs.partial_stacks = []
        self.backend.cs.system_status = 'partial'
        self.backend.cp_provider.get_consumer_auth_cp().getServiceLevelList = Mock(return_value=[])
        self.asyncBackend._find_suitable_service_levels('12345')
Beispiel #5
0
 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 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)
Beispiel #7
0
 def setUp(self):
     super(AsyncBackendTests, self).setUp()
     self.backend = StubBackend()
     self.asyncBackend = AsyncBackend(self.backend)
 def setUp(self):
     super(AsyncBackendTests, self).setUp()
     self.backend = StubBackend()
     self.asyncBackend = AsyncBackend(self.backend)