diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index b7ef0a9bb..e03f4e280 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -3,7 +3,7 @@ name: Unit test on: [push, pull_request] jobs: - lint-python: + unit-test: runs-on: ['self-hosted', 'Linux', 'X64'] steps: - name: Checkout diff --git a/tests/test_utils.py b/tests/test_utils.py index 4d941ed2f..8dc1d4df8 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -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 @@ -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):