Ejemplo n.º 1
0
    def test_positive_delete_subscription(self):
        """Check if deleting a subscription removes it from Activation key

        :id: bbbe4641-bfb0-48d6-acfc-de4294b18c15

        :expectedresults: Deleting subscription removes it from the Activation
            key

        :CaseLevel: Integration
        """
        new_ak = self._make_activation_key()
        with manifests.clone() as manifest:
            upload_file(manifest.content, manifest.filename)
        Subscription.upload({
            'file': manifest.filename,
            'organization-id': self.org['id'],
        })
        subscription_result = Subscription.list(
            {
                'organization-id': self.org['id'],
                'order': 'id desc'
            },
            per_page=False)
        result = ActivationKey.add_subscription({
            u'id':
            new_ak['id'],
            u'subscription-id':
            subscription_result[-1]['id'],
        })
        self.assertIn('Subscription added to activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id':
            new_ak['id'],
            u'organization-id':
            self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 6)
        result = ActivationKey.remove_subscription({
            u'id':
            new_ak['id'],
            u'subscription-id':
            subscription_result[-1]['id'],
        })
        self.assertIn('Subscription removed from activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id':
            new_ak['id'],
            u'organization-id':
            self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 4)
Ejemplo n.º 2
0
    def test_positive_delete_subscription(self):
        """Check if deleting a subscription removes it from Activation key

        :id: bbbe4641-bfb0-48d6-acfc-de4294b18c15

        :expectedresults: Deleting subscription removes it from the Activation
            key

        :CaseLevel: Integration
        """
        new_ak = self._make_activation_key()
        with manifests.clone() as manifest:
            upload_file(manifest.content, manifest.filename)
        Subscription.upload({
            'file': manifest.filename,
            'organization-id': self.org['id'],
        })
        subscription_result = Subscription.list({
            'organization-id': self.org['id'],
            'order': 'id desc'
        }, per_page=False)
        result = ActivationKey.add_subscription({
            u'id': new_ak['id'],
            u'subscription-id': subscription_result[-1]['id'],
        })
        self.assertIn('Subscription added to activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id': new_ak['id'],
            u'organization-id': self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 6)
        result = ActivationKey.remove_subscription({
            u'id': new_ak['id'],
            u'subscription-id': subscription_result[-1]['id'],
        })
        self.assertIn('Subscription removed from activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id': new_ak['id'],
            u'organization-id': self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 4)
Ejemplo n.º 3
0
    def test_positive_delete_subscription(self):
        """@Test: Check if deleting a subscription removes it from Activation key

        @Feature: Activation key - Subscription

        @Assert: Deleting subscription removes it from the Activation key
        """
        new_ak = self._make_activation_key()
        with manifests.clone() as manifest:
            upload_file(manifest.content, manifest.filename)
        Subscription.upload({
            'file': manifest.filename,
            'organization-id': self.org['id'],
        })
        subscription_result = Subscription.list({
            'organization-id': self.org['id'],
            'order': 'id desc'
        }, per_page=False)
        result = ActivationKey.add_subscription({
            u'id': new_ak['id'],
            u'subscription-id': subscription_result[-1]['id'],
        })
        self.assertIn('Subscription added to activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id': new_ak['id'],
            u'organization-id': self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 6)
        result = ActivationKey.remove_subscription({
            u'id': new_ak['id'],
            u'subscription-id': subscription_result[-1]['id'],
        })
        self.assertIn('Subscription removed from activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id': new_ak['id'],
            u'organization-id': self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 4)
    def test_positive_delete_subscription(self):
        """Check if deleting a subscription removes it from Activation key

        @Feature: Activation key - Subscription

        @Assert: Deleting subscription removes it from the Activation key
        """
        new_ak = self._make_activation_key()
        with manifests.clone() as manifest:
            upload_file(manifest.content, manifest.filename)
        Subscription.upload({
            'file': manifest.filename,
            'organization-id': self.org['id'],
        })
        subscription_result = Subscription.list({
            'organization-id': self.org['id'],
            'order': 'id desc'
        }, per_page=False)
        result = ActivationKey.add_subscription({
            u'id': new_ak['id'],
            u'subscription-id': subscription_result[-1]['id'],
        })
        self.assertIn('Subscription added to activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id': new_ak['id'],
            u'organization-id': self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 6)
        result = ActivationKey.remove_subscription({
            u'id': new_ak['id'],
            u'subscription-id': subscription_result[-1]['id'],
        })
        self.assertIn('Subscription removed from activation key', result)
        ak_subs_info = ActivationKey.subscriptions({
            u'id': new_ak['id'],
            u'organization-id': self.org['id'],
        })
        self.assertEqual(len(ak_subs_info), 4)
Ejemplo n.º 5
0
    def test_positive_delete_subscription(self):
        """Check if deleting a subscription removes it from Activation key

        @Feature: Activation key - Subscription

        @Assert: Deleting subscription removes it from the Activation key
        """
        new_ak = self._make_activation_key()
        with manifests.clone() as manifest:
            upload_file(manifest.content, manifest.filename)
        Subscription.upload({"file": manifest.filename, "organization-id": self.org["id"]})
        subscription_result = Subscription.list({"organization-id": self.org["id"], "order": "id desc"}, per_page=False)
        result = ActivationKey.add_subscription(
            {u"id": new_ak["id"], u"subscription-id": subscription_result[-1]["id"]}
        )
        self.assertIn("Subscription added to activation key", result)
        ak_subs_info = ActivationKey.subscriptions({u"id": new_ak["id"], u"organization-id": self.org["id"]})
        self.assertEqual(len(ak_subs_info), 6)
        result = ActivationKey.remove_subscription(
            {u"id": new_ak["id"], u"subscription-id": subscription_result[-1]["id"]}
        )
        self.assertIn("Subscription removed from activation key", result)
        ak_subs_info = ActivationKey.subscriptions({u"id": new_ak["id"], u"organization-id": self.org["id"]})
        self.assertEqual(len(ak_subs_info), 4)