(self, path: str, data: dict)
| 24 | self.url = os.environ.get("RESULTS_URL", "http://results-gatherer:8080") |
| 25 | |
| 26 | def _post(self, path: str, data: dict): |
| 27 | try: |
| 28 | req = urllib.request.Request( |
| 29 | f"{self.url}{path}", |
| 30 | data=json.dumps(data).encode(), |
| 31 | headers={"Content-Type": "application/json"}, |
| 32 | method="POST", |
| 33 | ) |
| 34 | urllib.request.urlopen(req, timeout=2) |
| 35 | except Exception: |
| 36 | pass |
| 37 | |
| 38 | def report(self, suite: str, test_name: str, status: str, detail: str = ""): |
| 39 | self._post("/result", { |