Пример #1
0
    async def test_add_account_namespace_to_name(self):
        app = ScheduledJob(**self.required_fields_scheduled_job)
        account = Account(**ACCOUNT_DEV_DICT)
        self.assertEqual(self.required_fields_scheduled_job["id"], app.id)

        app.add_namespace(account)
        expected_app_id = (
            f"{account.namespace}-{self.required_fields_scheduled_job['id'] }")
        self.assertEqual(expected_app_id, app.id)
Пример #2
0
    async def test_add_namespace_app_id_has_namespace_in_the_middle(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)

        app.add_namespace(account)
        expected_app_id = (
            f"{account.namespace}-{self.required_fields_scheduled_job['id'] }")
        self.assertEqual(expected_app_id, app.id)
Пример #3
0
    async def test_add_namespace_app_id_begins_with_namespace(self):
        """
        Adicionamos o namespace independente da app já ter o nome com
        exatamente o namespace no começo.
        """
        app = ScheduledJob(**self.required_fields_scheduled_job)
        account = Account(**ACCOUNT_DEV_DICT)
        self.assertEqual(self.required_fields_scheduled_job["id"], app.id)

        app.add_namespace(account)
        app.add_namespace(account)
        expected_app_id = f"{account.namespace}-{account.namespace }-{self.required_fields_scheduled_job['id']}"
        self.assertEqual(expected_app_id, app.id)