mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-30 14:56:11 +00:00
fix(tests): compare the extra state of two more dict fakes, one import style
CodeQL 978 and 979 (py/missing-equals): _Manager in the Funkwhale design-preferences test and _Tripwire in the resource lookup test add an attribute to a dict subclass without comparing it; both now define __eq__ over the dict content plus that attribute. CodeQL 1138 (py/import-and-import-from): test_requires_python imports unittest and unittest.mock once each instead of both import forms. 🎯 Fix: 92 % 💥 Break: 1 % 💸 Cost: 100 % ⏱️ Time: 100 % 🛡️ Security: ~100 % 🏆 Score: 91 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7006699309
commit
9e25443874
3 files changed
+16
-2
No files matched your search
@@ -2,8 +2,8 @@ from __future__ import annotations
|
||||
|
||||
import tempfile
|
||||
import unittest
|
||||
import unittest.mock
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
|
||||
@@ -17,7 +17,7 @@ class TestRequiresPythonLookup(unittest.TestCase):
|
||||
'[project]\nname = "demo"\nrequires-python = ">=3.12,<3.14"\n',
|
||||
encoding="utf-8",
|
||||
)
|
||||
with mock.patch.object(plugin, "PROJECT_ROOT", Path(tmp)):
|
||||
with unittest.mock.patch.object(plugin, "PROJECT_ROOT", Path(tmp)):
|
||||
self.assertEqual(plugin.LookupModule().run([]), [">=3.12,<3.14"])
|
||||
|
||||
def test_the_lookup_takes_no_terms(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user