Beispiel #1
0
    async def test_remove_account_namespace_app_id_does_not_have_namespace(
            self):
        app = ScheduledJob(**self.required_fields_scheduled_job)
        account = Account(**ACCOUNT_DEV_DICT)
        self.assertEqual(self.required_fields_scheduled_job["id"], app.id)

        app.remove_namespace(account)
        self.assertEqual(self.required_fields_scheduled_job["id"], app.id)
Beispiel #2
0
    async def test_remove_namespace_only_once(self):
        account = Account(**ACCOUNT_DEV_DICT)
        self.required_fields_scheduled_job[
            "id"] = f"{account.namespace}-{account.namespace}-my-app-with-ns"
        app = ScheduledJob(**self.required_fields_scheduled_job)

        app.remove_namespace(account)
        expected_app_id = f"{account.namespace}-my-app-with-ns"
        self.assertEqual(expected_app_id, app.id)
Beispiel #3
0
    async def test_remove_namespace_app_id_contains_namespace(self):
        """
        Se o namepspace está no meio do nome, não deve ser removido
        """
        account = Account(**ACCOUNT_DEV_DICT)
        self.required_fields_scheduled_job[
            "id"] = f"my-app-with-{account.namespace}-ns"
        app = ScheduledJob(**self.required_fields_scheduled_job)

        app.remove_namespace(account)
        self.assertEqual(self.required_fields_scheduled_job["id"], app.id)
Beispiel #4
0
    async def test_remove_namepace_returns_self(self):

        account = Account(**ACCOUNT_DEV_DICT)
        self.required_fields_scheduled_job[
            "id"] = f"my-app-with-{account.namespace}-ns"
        app = ScheduledJob(**self.required_fields_scheduled_job)

        returned_app = app.remove_namespace(account)
        self.assertTrue(app is returned_app)