@flaky(u'FLOC-3330')
    @if_docker_configured
    def test_cpu_shares(self):
        EXPECTED_CPU_SHARES = 512

        image = DockerImage.from_string(u"openshift/busybox-http-app")

        application_name = random_name(self)

        docker_client = DockerClient()
        self.addCleanup(docker_client.remove, application_name)

        deployer = ApplicationNodeDeployer(
            u"localhost", docker_client, make_memory_network(),
            node_uuid=uuid4())

        desired_state = Deployment(nodes=frozenset([
            Node(uuid=deployer.node_uuid,
                 applications=frozenset([Application(
                     name=application_name,
                     image=image,
                     cpu_shares=EXPECTED_CPU_SHARES
                     )]))]))

        d = change_node_state(deployer, desired_state)
        d.addCallback(lambda _: wait_for_unit_state(
            reactor,
            docker_client,
            application_name,
            [u'active'])
        )

        def inspect_application(_):
            deferred_list = docker_client.list()

            def app_cpu_shares(unit):
                self.assertEqual(unit.cpu_shares, EXPECTED_CPU_SHARES)

            deferred_list.addCallback(find_unit, application_name)
            deferred_list.addCallback(app_cpu_shares)
            return deferred_list
        d.addCallback(inspect_application)
        return d
Test all endpoints needs authentication.
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/functional/test_deploy.py/DeployerTests.test_cpu_shares--crossover with--dataset/ETHPy150Open tomwilkie/awesomation/src/appengine/auth_tests.py/AuthTests.testEndpointsReturn401