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 Sep 21, 2020
1 parent f7a7614 commit 26063c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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 26063c3

Please sign in to comment.