def test_add_namespace_create_new_app(self): """ Para novas apps, sempre vamos adicionar o prefixo. """ modified_app = self.filter.write(self.user, self.request_app, SieveMarathonApp()) self.assertEqual("/dev/foo", modified_app.id)
def test_response_apps_returns_none_if_outside_current_namespace(self, single_full_app_with_tasks_fixture): request_app = original_app =SieveMarathonApp.from_json(single_full_app_with_tasks_fixture) request_app.id = original_app.id = "/othernamespace/foo" self.assertIsNone(self.filter.response(self.user, request_app, original_app))
def test_create_app_remove_traefik_backend_label_exists(self): self.request_app.labels['traefik.backend'] = 'my-app-backend' filtered_app = self.filter.write(None, self.request_app, SieveMarathonApp()) self.assertFalse('traefik.backend' in filtered_app.labels.keys())
def test_update_app_remove_traefik_backend_label_do_not_exist(self): filtered_app = self.filter.write(None, self.request_app, SieveMarathonApp()) self.assertFalse('traefik.backend' in filtered_app.labels.keys())
def setUp(self, single_full_app_fixture): self.filter = LabelsFilter() self.single_full_app_fixture = single_full_app_fixture self.request_app = SieveMarathonApp.from_json(self.single_full_app_fixture) self.original_app = SieveMarathonApp.from_json(self.single_full_app_fixture)