示例#1
0
    def test_response_deployments_remove_namespace_from_all_app_ids(self, fixture):
        deployment = MarathonDeployment.from_json(fixture[0])
        self.filter.response_deployment(self.user, deployment, deployment)

        self.assertEqual(deployment.affected_apps, ['/foo'])

        current_action_apps = [action.app for action in deployment.current_actions]
        self.assertEqual(current_action_apps, ['/foo'])

        actions = [step.actions for step in deployment.steps]
        step_apps = [action.app for action in  chain.from_iterable(actions)]
        self.assertEqual(step_apps, ['/foo', '/foo'])
示例#2
0
 def test_response_deployments_return_none_if_outside_current_namespace(
         self, fixture):
     deployment = MarathonDeployment.from_json(fixture[0])
     deployment.affected_apps = ["/othernamespace/foo"]
     self.assertIsNone(
         self.filter.response_deployment(self.user, deployment, deployment))