def test_api_validated(self): limit = 60 while Api().noResponse('http://'+ self.ip +':80/carts/579f21ae98684924944651bf'): if limit == 0: self.fail("Couldn't get the API running") limit = limit - 1 sleep(1) out = Dredd().test_against_endpoint("carts", "http://cart/", links=[self.mongo_container_name, self.container_name], env=[("MONGO_ENDPOINT", "mongodb://cart-db:27017/data")]) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1)
def test_api_validated(self): self.wait_or_fail('http://' + self.ip + ':8080/catalogue') out = Dredd().test_against_endpoint("catalogue", "http://catalogue/", links=[ self.container_name, "{}:mysql".format( self.mysql_container_name) ]) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1) print(out)
def test_api_validated(self): limit = 30 while Api().noResponse('http://' + self.ip + ':80/payments/'): if limit == 0: self.fail("Couldn't get the API running") limit = limit - 1 sleep(1) out = Dredd().test_against_endpoint("payment", 'http://' + self.ip + ':80/', links=[self.container_name], dump_streams=True) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1)
def test_api_validated(self): limit = 30 while Api().noResponse('http://' + self.ip + ':80/carts/'): if limit == 0: self.fail("Couldn't get the API running") limit = limit - 1 sleep(1) out = Dredd().test_against_endpoint( "cart", "http://cart/", links=[self.mongo_container_name, self.container_name], env=[("MONGO_ENDPOINT", "mongodb://cart-db:27017/data")], dump_streams=True) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1) print(out)
def test_api_validated(self): limit = 30 while Api().noResponse('http://' + self.ip + ':80/orders'): if limit == 0: self.fail("Couldn't get the API running") limit = limit - 1 sleep(1) out = Dredd().test_against_endpoint( "orders", 'http://' + self.ip + ':80/', links=[self.mongo_container_name, self.container_name], env=[("MONGO_ENDPOINT", "mongodb://orders-db:27017/data")], dump_streams=True) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1) print(out)
def test_api_validated(self): limit = 30 url = f'http://{self.ip}:{PaymentContainerTest.PORT}/' while Api().noResponse(url + 'payments/'): if limit == 0: self.fail("Couldn't get the API running") limit = limit - 1 sleep(1) out = Dredd().test_against_endpoint("payment", url, links=[self.container_name], dump_streams=True) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1)
def test_api_validated(self): print("+Entering test api validated") print("+self.ip: " + self.ip) limit = 30 while Api().noResponse('http://' + self.ip + ':80/orders'): if limit == 0: self.fail("Couldn't get the API running") limit = limit - 1 sleep(1) print("+self.ip: " + self.ip) out = Dredd().test_against_endpoint( "orders-aws", 'http://' + self.ip + ':80/', links=[self.dynamodb_container_name, self.container_name], env=[("AWS_DYNAMODB_ENDPOINT", "http://orders-db:8080"), ("AWS_ACCESS_KEY", "foo"), ("AWS_SECRET_KEY", "bar"), ("PORT", "80")], dump_streams=True) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1) print(out)
def test_api_validated(self): self.wait_or_fail('http://'+ self.ip +':80/catalogue') out = Dredd().test_against_endpoint("catalogue", "http://catalogue/", links=[self.container_name, "{}:mysql".format(self.mysql_container_name)]) self.assertGreater(out.find("0 failing"), -1) self.assertGreater(out.find("0 errors"), -1) print(out)