Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 7224e24

Browse files
committed
add tests for utils.getNodesQueue
1 parent f7a7614 commit 7224e24

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

tests/test_utils.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -820,15 +820,24 @@ def getresponse(self):
820820
response, [[{'name': 'someSite'}, {'name': 'someSite1'}]])
821821

822822

823-
class TestGetAllAgents(unittest.TestCase):
824-
def test_getAllAgents(self):
825-
from WmAgentScripts.utils import getBlockLocations as getAllAgents
823+
class TestGetBlockLocations(unittest.TestCase):
824+
def test_getBlockLocations(self):
825+
from WmAgentScripts.utils import getBlockLocations
826826

827827
with patch('WmAgentScripts.utils.make_x509_conn', mock_make_x509_conn):
828-
response = getAllAgents(url=reqmgr_url, dataset=test_dataset)
828+
response = getBlockLocations(url=reqmgr_url, dataset=test_dataset)
829829
self.assertDictEqual(response, {})
830830

831831

832+
class TestGetNodesQueue(unittest.TestCase):
833+
def test_getNodesQueue(self):
834+
from WmAgentScripts.utils import getNodesQueue
835+
836+
with patch('WmAgentScripts.utils.make_x509_conn', mock_make_x509_conn):
837+
response = getNodesQueue(url=reqmgr_url)
838+
self.assertIn('T3_RU_MEPhI', response)
839+
840+
832841
class TestAgentSpeedDraining(unittest.TestCase):
833842
def test_agent_speed_draining(self):
834843
from WmAgentScripts.utils import agent_speed_draining
@@ -839,7 +848,7 @@ def test_agent_speed_draining(self):
839848

840849

841850
class TestBatchInfo(unittest.TestCase):
842-
def test_content(self):
851+
def test_batchInfo(self):
843852
from WmAgentScripts.utils import batchInfo
844853

845854
with patch('WmAgentScripts.utils.mongo_client', mock_mongo_client):

0 commit comments

Comments
 (0)