Skip to content

Commit

Permalink
fix async util tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parkererickson-tg committed Oct 1, 2024
1 parent dff6558 commit 37e7566
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyTigerGraph/pytgasync/pyTigerGraphUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ async def getSystemMetrics(self, from_ts: int = None, to_ts: int = None, latest:

# Couldn't be placed in prep since version checking requires await statements
if what:
if await self._versionGreaterThan4_0():
if await self._version_greater_than_4_0():
if what == "servicestate" or what == "connection":
raise TigerGraphException(
"This 'what' parameter is only supported on versions of TigerGraph < 4.1.0.", 0)
if what == "cpu" or what == "mem":
what = "cpu-memory" # in >=4.1 cpu and mem have been conjoined into one category
params["what"] = what
# in >=4.1 the datapoints endpoint has been removed and replaced
if await self._versionGreaterThan4_0():
if await self._version_greater_than_4_0():
res = await self._req("POST", self.gsUrl+"/informant/metrics/get/"+what, data=_json, jsonData=True, resKey="")
else:
res = await self._req("GET", self.gsUrl+"/ts3/api/datapoints", authMode="pwd", params=params, resKey="")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pyTigerGraphUtilsAsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ async def test_06_getSystemMetrics(self):
else:
res = await self.conn.getSystemMetrics(what="mem", latest=10)
self.assertEqual(len(res), 10)

'''
async def test_07_getQueryPerformance(self):
res = await self.conn.getQueryPerformance()
self.assertIn("CompletedRequests", str(res))

'''
async def test_08_getServiceStatus(self):
req = {"ServiceDescriptors": [{"ServiceName": "GSQL"}]}
res = await self.conn.getServiceStatus(req)
Expand Down

0 comments on commit 37e7566

Please sign in to comment.