Skip to content

Commit

Permalink
style: black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rezib committed Jan 2, 2025
1 parent e14754c commit 3afafb8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions slurmweb/tests/apps/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from ..lib.utils import mock_agent_response, fake_text_response


class TestVersionComparaison(unittest.TestCase):

def test_version_greater_or_equal(self):
Expand Down Expand Up @@ -42,15 +43,15 @@ def test_agents(self, mock_requests_get):
self.assertEqual(len(vars(agent)), 4)
self.assertEqual(agent.cluster, agent_info["cluster"])
self.assertEqual(agent.racksdb.version, agent_info["racksdb"]["version"])
self.assertEqual(agent.racksdb.infrastructure, agent_info["racksdb"]["infrastructure"])
self.assertEqual(
agent.racksdb.infrastructure, agent_info["racksdb"]["infrastructure"]
)
self.assertEqual(agent.metrics, agent_info["metrics"])
self.assertEqual(agent.url, self.app.settings.agents.url[0].geturl())

@mock.patch("slurmweb.apps.gateway.requests.get")
def test_agents_missing_key(self, mock_requests_get):
agent_info, mock_requests_get.return_value = mock_agent_response(
"info"
)
agent_info, mock_requests_get.return_value = mock_agent_response("info")
del agent_info["metrics"]
with self.assertLogs("slurmweb", level="ERROR") as cm:
agents = self.app.agents
Expand All @@ -66,9 +67,7 @@ def test_agents_missing_key(self, mock_requests_get):

@mock.patch("slurmweb.apps.gateway.requests.get")
def test_agents_unsupported_racksdb_version(self, mock_requests_get):
agent_info, mock_requests_get.return_value = mock_agent_response(
"info"
)
agent_info, mock_requests_get.return_value = mock_agent_response("info")
agent_info["racksdb"]["version"] = "0.3.0"
with self.assertLogs("slurmweb", level="ERROR") as cm:
agents = self.app.agents
Expand Down

0 comments on commit 3afafb8

Please sign in to comment.