def _test_create_container(self, request_data, node_data):
        saving = self.persistence_service.save(Deployment(
            nodes={
                Node(uuid=self.NODE_A_UUID),
                Node(uuid=self.NODE_B_UUID),
            }
        ))

        for request in request_data:
            saving.addCallback(
                lambda _, req=request: self.assertResponseCode(
                    b"POST", b"/configuration/containers",
                    req, CREATED
                ))

        def created(_):
            deployment = self.persistence_service.get()
            expected = Deployment(
                nodes=node_data
            )
            self.assertEqual(deployment, expected)

        saving.addCallback(created)
        return saving
Utility method to create one or more containers via the API and
dataset/ETHPy150Open ClusterHQ/flocker/flocker/control/test/test_httpapi.py/CreateContainerTestsMixin._test_create_container