def test_update_new_host(self):
        d = self._create_container()

        d.addCallback(lambda _: self.persistence_service.get())

        def handle_expected(expected):
            dr = self.assertResponseCode(
                b"POST", b"/configuration/containers/mycontainer",
                {u"node_uuid": self.NODE_B}, OK
            )

            def updated(_):
                deployment = self.persistence_service.get()
                application = Application(
                    name=u"mycontainer",
                    image=DockerImage.from_string(u"busybox"),
                )
                real_expected = expected
                for node in expected.nodes:
                    if node.uuid == self.NODE_B_UUID:
                        node = node.transform(
                            ["applications"], lambda s: s.add(application)
                        )
                    else:
                        node = node.transform(
                            ["applications"], lambda s: s.remove(application)
                        )
                    real_expected = real_expected.update_node(node)
                self.assertEqual(deployment, real_expected)

            dr.addCallback(updated)
            return dr

        d.addCallback(handle_expected)
        return d
Adds a new redaction rule that will be applied after all previously added redaction rules.
dataset/ETHPy150Open ClusterHQ/flocker/flocker/control/test/test_httpapi.py/UpdateContainerConfigurationTestsMixin.test_update_new_host--crossover with--dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/log_processing.py/LogFileProcessor.add_redacter