's'
This commit is contained in:
23
d2ypp2/tests/test_runtime_bootstrap.py
Normal file
23
d2ypp2/tests/test_runtime_bootstrap.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from src.runtime_bootstrap import compute_nofile_target, load_msg_push_exports
|
||||
|
||||
|
||||
class RuntimeBootstrapTests(unittest.TestCase):
|
||||
def test_compute_nofile_target_respects_minimum_and_hard_limit(self) -> None:
|
||||
self.assertEqual(compute_nofile_target(1024, 524288), 65536)
|
||||
self.assertEqual(compute_nofile_target(131072, 65535), 65535)
|
||||
|
||||
def test_load_msg_push_exports_falls_back_to_noop_when_backup_missing(self) -> None:
|
||||
with patch("builtins.__import__", side_effect=ModuleNotFoundError("backup")):
|
||||
funcs = load_msg_push_exports()
|
||||
self.assertEqual(len(funcs), 7)
|
||||
result = funcs[0]("demo")
|
||||
self.assertTrue(result["disabled"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user