Skip to content

Commit

Permalink
Unit tests - Use create_random_pics instead of creating PICS
Browse files Browse the repository at this point in the history
  • Loading branch information
rquidute committed Oct 22, 2024
1 parent 20aa518 commit 52c1d05
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions app/tests/utils/test_run_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,10 @@
from app.schemas.pics import PICS
from app.schemas.test_run_execution import TestRunExecutionCreate
from app.tests.utils.project import create_random_project
from app.tests.utils.test_pics_data import create_random_pics

fake = Faker()

default_pics = {
"clusters": {
"Access Control cluster": {
"name": "Access Control cluster",
"items": {"ACL.S": {"number": "ACL.S", "enabled": True}},
}
}
}


def random_test_run_execution_dict(
state: Optional[TestStateEnum] = None,
Expand Down Expand Up @@ -123,7 +115,7 @@ def create_random_test_run_execution_with_test_case_states(
"sample_tests": {"SampleTestSuite1": {"TCSS1001": num_test_cases}}
}
test_run_execution = create_random_test_run_execution(
db=db, selected_tests=selected_tests, pics=default_pics
db=db, selected_tests=selected_tests, pics=create_random_pics()
)

test_suite_execution = test_run_execution.test_suite_executions[0]
Expand All @@ -141,7 +133,7 @@ def create_random_test_run_execution_with_test_case_states(


def create_test_run_execution_with_some_test_cases(
db: Session, pics: Optional[PICS] = default_pics, **kwargs: Any
db: Session, pics: Optional[PICS] = create_random_pics(), **kwargs: Any
) -> TestRunExecution:
return create_random_test_run_execution(
db=db,
Expand Down

0 comments on commit 52c1d05

Please sign in to comment.