Beispiel #1
0
    def test_memcached(self):
        options = gnomock.Options()
        preset = gnomock.Memcached(version="1.6.6-alpine")
        memcached_request = gnomock.MemcachedRequest(options=options, preset=preset)
        id = ""

        try:
            response = self.api.start_memcached(memcached_request)
            id = response.id
            self.assertEqual("127.0.0.1", response.host)

        finally:
            if id is not "":
                stop_request = gnomock.StopRequest(id=id)
                self.api.stop(stop_request)
Beispiel #2
0
    def test_memcached(self):
        options = gnomock.Options()
        values = {
            "foo": "bar",
        }
        byte_values = {"key": "Z25vbW9jawo="}
        preset = gnomock.Memcached(version="1.6.6-alpine",
                                   values=values,
                                   byte_values=byte_values)
        memcached_request = gnomock.MemcachedRequest(options=options,
                                                     preset=preset)
        id = ""

        try:
            response = self.api.start_memcached(memcached_request)
            id = response.id
            self.assertEqual("127.0.0.1", response.host)

        finally:
            if id != "":
                stop_request = gnomock.StopRequest(id=id)
                self.api.stop(stop_request)