Files
mongo/buildscripts/tests/resmoke_proxy/test_resmoke_proxy.py
Steve McClure b4b23946cd SERVER-90570: Enable formatting checks for buildscripts directory, excluding idl (#22254)
GitOrigin-RevId: 9d997a9f44cd43a8dec7c2a17fa2dbcd875e92f6
2024-05-16 22:07:36 +00:00

24 lines
719 B
Python

"""Unit tests for resmoke_proxy.py."""
import unittest
from unittest.mock import MagicMock
from buildscripts.resmoke_proxy import resmoke_proxy as under_test
# pylint: disable=protected-access
class TestResmokeProxy(unittest.TestCase):
def test_list_tests_can_handle_strings_and_lists(self):
mock_suite = MagicMock(
tests=["test0", "test1", ["test2a", "tests2b", "test2c"], "test3", ["test4a"]]
)
resmoke_proxy = under_test.ResmokeProxyService()
resmoke_proxy._suite_config = MagicMock()
resmoke_proxy._suite_config.get_suite.return_value = mock_suite
test_list = resmoke_proxy.list_tests("some suite")
self.assertEqual(len(test_list), 7)