예제 #1
0
 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)
예제 #2
0
    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))
예제 #3
0
 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())
예제 #4
0
 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())
예제 #5
0
 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)