rehearsal: re-pin handler accounting 244->247 and longfunc inventory 17->18 (main-side _routing_shadow + 2 methods, zero source methods lost; same re-pin precedent as 34b9a34)
This commit is contained in:
1 parent
1eefe17474
commit
da027f8628
2 files changed
+12
-5
No files matched your search
@@ -144,7 +144,11 @@ class TestReexports(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class TestMethodAccounting(unittest.TestCase):
|
class TestMethodAccounting(unittest.TestCase):
|
||||||
def test_total_244_no_duplicates(self):
|
# 演练注:合入后总数 244 -> 247、server.py 自有 150 -> 153,
|
||||||
|
# 增量全是 main 侧方法(_routing_shadow、_resolve_create_
|
||||||
|
# agent_definition、_validate_create_audit_loop),源线方法
|
||||||
|
# 零丢失、mixin 侧零增减;此为源线 34b9a34 同款 re-pin。
|
||||||
|
def test_total_247_no_duplicates(self):
|
||||||
seen = {}
|
seen = {}
|
||||||
dups = []
|
dups = []
|
||||||
classes = [CloudControlPlaneHandler]
|
classes = [CloudControlPlaneHandler]
|
||||||
@@ -159,9 +163,9 @@ class TestMethodAccounting(unittest.TestCase):
|
|||||||
dups.append((seen[name], cls.__name__, name))
|
dups.append((seen[name], cls.__name__, name))
|
||||||
seen[name] = cls.__name__
|
seen[name] = cls.__name__
|
||||||
self.assertEqual(dups, [])
|
self.assertEqual(dups, [])
|
||||||
self.assertEqual(total, 244)
|
self.assertEqual(total, 247)
|
||||||
self.assertEqual(len(_own_methods(CloudControlPlaneHandler)),
|
self.assertEqual(len(_own_methods(CloudControlPlaneHandler)),
|
||||||
244 - 94)
|
247 - 94)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -48,11 +48,14 @@ EXPECTED_METHODS = {
|
|||||||
("server.py", "CloudControlPlaneHandler._dispatch_task_route"),
|
("server.py", "CloudControlPlaneHandler._dispatch_task_route"),
|
||||||
("server.py", "CloudControlPlaneHandler._dispatch"),
|
("server.py", "CloudControlPlaneHandler._dispatch"),
|
||||||
("server.py", "CloudControlPlaneHandler._dispatch_project"),
|
("server.py", "CloudControlPlaneHandler._dispatch_project"),
|
||||||
|
# 演练注:main 侧 _routing_shadow(233 行)为第 18 个长方法;
|
||||||
|
# 另 2 个 main 侧新增方法均 <=100 行,不进清单。
|
||||||
|
("server.py", "CloudControlPlaneHandler._routing_shadow"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class LongFuncInventoryTestCase(unittest.TestCase):
|
class LongFuncInventoryTestCase(unittest.TestCase):
|
||||||
def test_seventeen_long_methods_including_full_auto_execute(self):
|
def test_eighteen_long_methods_including_full_auto_execute(self):
|
||||||
cloud_dir = Path(__file__).resolve().parents[1]
|
cloud_dir = Path(__file__).resolve().parents[1]
|
||||||
methods = set()
|
methods = set()
|
||||||
module_funcs = set()
|
module_funcs = set()
|
||||||
@@ -75,7 +78,7 @@ class LongFuncInventoryTestCase(unittest.TestCase):
|
|||||||
lines = node.end_lineno - node.lineno + 1
|
lines = node.end_lineno - node.lineno + 1
|
||||||
if lines > 100:
|
if lines > 100:
|
||||||
module_funcs.add((path.name, node.name))
|
module_funcs.add((path.name, node.name))
|
||||||
self.assertEqual(len(EXPECTED_METHODS), 17)
|
self.assertEqual(len(EXPECTED_METHODS), 18)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
("handler_fullauto.py", "FullAutoMixin._full_auto_execute"),
|
("handler_fullauto.py", "FullAutoMixin._full_auto_execute"),
|
||||||
EXPECTED_METHODS)
|
EXPECTED_METHODS)
|
||||||
|
|||||||
Reference in new issue
Block a user