'``DockerClient.add`` accepts an integer cpu_shares parameter which is
passed to Docker when creating a container as the CPU shares weight
for that container. This is a relative weight for CPU time versus other
containers and does not directly constrain CPU usage, i.e. a CPU share
constrained container can still use 100% CPU if other containers are
idle. Default shares when unspecified is 1024.'

def test_add_with_cpu_shares(self):

    name = random_name(self)
    d = self.start_container(name, cpu_shares=512)
    def started(_):
        docker = dockerpy_client()
        data = docker.inspect_container((self.namespacing_prefix + name))
        self.assertEqual(data[u'Config'][u'CpuShares'], 512)
    d.addCallback(started)
    return d
