fix: lint error and make test deterministic
This commit is contained in:
parent
d7457adeba
commit
c69c3b7c11
2 changed files with 15 additions and 3 deletions
|
|
@ -71,9 +71,21 @@ async def test_circular_reference_extraction():
|
||||||
for file_index in range(1500)
|
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_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(
|
code_file.contains.extend(
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ async def test_circular_reference_extraction():
|
||||||
repo = Repository(path="repo1")
|
repo = Repository(path="repo1")
|
||||||
|
|
||||||
code_file_1 = CodeFile(
|
code_file_1 = CodeFile(
|
||||||
id=uuid5(NAMESPACE_OID, f"file_0"),
|
id=uuid5(NAMESPACE_OID, "file_0"),
|
||||||
source_code="source code",
|
source_code="source code",
|
||||||
part_of=repo,
|
part_of=repo,
|
||||||
contains=[],
|
contains=[],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue