MCPcopy Index your code
hub / github.com/Codeplain-ai/codeplain / FakeModule

Class FakeModule

tests/test_change_detection.py:11–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class FakeModule:
12 def __init__(
13 self,
14 module_name: str,
15 current_frs: list[str],
16 stored_frs: list[str] | None = None,
17 current_non_fr_hash: str = "match",
18 stored_non_fr_hash: str | None = "match",
19 ):
20 self.module_name = module_name
21 self._current_frs = current_frs
22 self._stored_frs = stored_frs
23 self._current_non_fr_hash = current_non_fr_hash
24 self._stored_non_fr_hash = stored_non_fr_hash
25 self.required_modules: list[FakeModule] = []
26
27 @property
28 def all_required_modules(self) -> list["FakeModule"]:
29 result = []
30 for rm in self.required_modules:
31 result.extend(rm.all_required_modules)
32 result.append(rm)
33 return result
34
35 def load_module_metadata(self) -> dict | None:
36 if self._stored_frs is None:
37 return None
38 metadata: dict = {"functionalities": self._stored_frs}
39 if self._stored_non_fr_hash is not None:
40 metadata["non_functional_source_hash"] = self._stored_non_fr_hash
41 return metadata
42
43 def _get_module_functional_requirements(self) -> list[str]:
44 return self._current_frs
45
46 def get_module_non_functional_source_hash(self) -> str:
47 return self._current_non_fr_hash
48
49
50# --- No changes ---

Callers 15

test_single_editFunction · 0.70
test_multiple_editsFunction · 0.70
test_addition_at_endFunction · 0.70
test_removal_at_endFunction · 0.70
test_edit_and_additionFunction · 0.70

Calls

no outgoing calls

Tested by 15

test_single_editFunction · 0.56
test_multiple_editsFunction · 0.56
test_addition_at_endFunction · 0.56
test_removal_at_endFunction · 0.56
test_edit_and_additionFunction · 0.56