fix: lint error and make test deterministic

This commit is contained in:
Boris Arzentar 2025-07-09 00:50:52 +02:00
parent d7457adeba
commit c69c3b7c11
No known key found for this signature in database
GPG key ID: D5CC274C784807B7
2 changed files with 15 additions and 3 deletions

View file

@ -71,9 +71,21 @@ async def test_circular_reference_extraction():
for file_index in range(1500)
]
for code_file in code_files:
for index, code_file in enumerate(code_files):
first_index = index
second_index = index
while first_index == index:
first_index = random.randint(0, len(code_files) - 1)
while second_index == index:
second_index = random.randint(0, len(code_files) - 1)
code_file.depends_on.extend(
[code_files[random.randint(0, len(code_files) - 1)] for _ in range(2)]
[
code_files[first_index],
code_files[second_index],
]
)
code_file.contains.extend(
[

View file

@ -39,7 +39,7 @@ async def test_circular_reference_extraction():
repo = Repository(path="repo1")
code_file_1 = CodeFile(
id=uuid5(NAMESPACE_OID, f"file_0"),
id=uuid5(NAMESPACE_OID, "file_0"),
source_code="source code",
part_of=repo,
contains=[],