ec40e2d0dda2ffda88f553f06c2ce1362e6fc77b,tests/test_jobs/test_models.py,TestJobModel,test_create_job_with_valid_spec,#TestJobModel#Any#,117
Before Change
mock_instance.start_job.return_value = {"pod": "pod_content"}
mock_instance.spec = config
with patch("scheduler.dockerizer_scheduler.start_dockerizer") as mock_start:
with patch("scheduler.dockerizer_scheduler.check_image") as mock_check:
mock_start.return_value = False
mock_check.return_value = True
job = JobFactory(config=config.parsed_data)
assert JobStatus.objects.filter(job=job).count() == 2
assert list(JobStatus.objects.filter(job=job).values_list(
"status", flat=True)) == [JobLifeCycle.CREATED,
JobLifeCycle.SCHEDULED]
After Change
mock_instance.start_job.return_value = {"pod": "pod_content"}
mock_instance.spec = config
with patch("scheduler.dockerizer_scheduler.create_build_job") as mock_start:
build = BuildJobFactory()
BuildJobStatus.objects.create(status=JobLifeCycle.SUCCEEDED, job=build)
mock_start.return_value = build, True, True
job = JobFactory(config=config.parsed_data)
assert JobStatus.objects.filter(job=job).count() == 2
assert list(JobStatus.objects.filter(job=job).values_list(
"status", flat=True)) == [JobLifeCycle.CREATED,
JobLifeCycle.SCHEDULED]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 12
Instances
Project Name: polyaxon/polyaxon
Commit Name: ec40e2d0dda2ffda88f553f06c2ce1362e6fc77b
Time: 2019-02-10
Author: mouradmourafiq@gmail.com
File Name: tests/test_jobs/test_models.py
Class Name: TestJobModel
Method Name: test_create_job_with_valid_spec
Project Name: polyaxon/polyaxon
Commit Name: ec40e2d0dda2ffda88f553f06c2ce1362e6fc77b
Time: 2019-02-10
Author: mouradmourafiq@gmail.com
File Name: tests/test_jobs/test_models.py
Class Name: TestJobModel
Method Name: test_create_job_with_resources_spec
Project Name: polyaxon/polyaxon
Commit Name: ec40e2d0dda2ffda88f553f06c2ce1362e6fc77b
Time: 2019-02-10
Author: mouradmourafiq@gmail.com
File Name: tests/test_jobs/test_models.py
Class Name: TestJobModel
Method Name: test_job_creation_with_already_built_triggers_scheduling