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

Commit

Permalink
add tests for utils.getNodesQueue
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanrai05 committed Aug 9, 2020
1 parent f7a7614 commit 7224e24
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,15 +820,24 @@ def getresponse(self):
response, [[{'name': 'someSite'}, {'name': 'someSite1'}]])


class TestGetAllAgents(unittest.TestCase):
def test_getAllAgents(self):
from WmAgentScripts.utils import getBlockLocations as getAllAgents
class TestGetBlockLocations(unittest.TestCase):
def test_getBlockLocations(self):
from WmAgentScripts.utils import getBlockLocations

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


class TestGetNodesQueue(unittest.TestCase):
def test_getNodesQueue(self):
from WmAgentScripts.utils import getNodesQueue

with patch('WmAgentScripts.utils.make_x509_conn', mock_make_x509_conn):
response = getNodesQueue(url=reqmgr_url)
self.assertIn('T3_RU_MEPhI', response)


class TestAgentSpeedDraining(unittest.TestCase):
def test_agent_speed_draining(self):
from WmAgentScripts.utils import agent_speed_draining
Expand All @@ -839,7 +848,7 @@ def test_agent_speed_draining(self):


class TestBatchInfo(unittest.TestCase):
def test_content(self):
def test_batchInfo(self):
from WmAgentScripts.utils import batchInfo

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

0 comments on commit 7224e24

Please sign in to comment.