コード例 #1
0
			})
		})
	})

	Describe("CurrentDiskLimits", func() {
		BeforeEach(func() {
			server.AppendHandlers(
				ghttp.CombineHandlers(
					ghttp.VerifyRequest("GET", "/api/containers/containerhandle/disk_limit"),
					ghttp.RespondWith(200, `{"byte_hard": 456}`),
				),
			)
		})

		It("returns the limit", func() {
			limit, err := container.CurrentDiskLimits()
			Expect(err).NotTo(HaveOccurred())
			Expect(limit.ByteHard).To(Equal(uint64(456)))
		})
	})

	Describe("LimitCPU", func() {
		var requestBody string
		Context("success", func() {
			BeforeEach(func() {
				server.AppendHandlers(
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("POST", "/api/containers/containerhandle/cpu_limit"),
						ghttp.RespondWith(200, `{}`),
						func(w http.ResponseWriter, req *http.Request) {
							body, err := ioutil.ReadAll(req.Body)