project_name string | class_name string | class_modifiers string | class_implements int64 | class_extends int64 | function_name string | function_body string | cyclomatic_complexity int64 | NLOC int64 | num_parameter int64 | num_token int64 | num_variable int64 | start_line int64 | end_line int64 | function_index int64 | function_params string | function_variable string | function_return_type string | function_body_line_type string | function_num_functions int64 | function_num_lines int64 | outgoing_function_count int64 | outgoing_function_names string | incoming_function_count int64 | incoming_function_names string | lexical_representation string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_record_upload_summary | def test_record_upload_summary(fresh_deadline_config, mock_telemetry_client):"""Tests that recording an upload summary sends the expected TelemetryEvent to the thread queue"""# GIVENqueue_mock = MagicMock()test_summary = SummaryStatistics(total_bytes=123, total_files=12, total_time=12345)expected_summary = asdict(test_... | 1 | 16 | 2 | 108 | 4 | 233 | 254 | 233 | fresh_deadline_config,mock_telemetry_client | ['expected_event', 'queue_mock', 'expected_summary', 'test_summary'] | None | {"Assign": 7, "Expr": 3, "With": 1} | 8 | 22 | 8 | ["MagicMock", "SummaryStatistics", "asdict", "TelemetryEvent", "patch.object", "patch.object", "mock_telemetry_client.record_upload_summary", "queue_mock.put_nowait.assert_called_once_with"] | 0 | [] | The function (test_record_upload_summary) defined within the public class called public.The function start at line 233 and ends at 254. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [233.0] and does not return any value. It declares 8.0 functions, and It ha... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_record_error | def test_record_error(fresh_deadline_config, mock_telemetry_client):"""Test that recording an error sends the expected TelemetryEvent to the thread queue"""# GIVENqueue_mock = MagicMock()test_error_details = {"some_field": "some_value"}test_exc = Exception("some exception")expected_event_details = {"some_field": "some_... | 1 | 19 | 2 | 116 | 5 | 257 | 281 | 257 | fresh_deadline_config,mock_telemetry_client | ['expected_event_details', 'expected_event', 'test_exc', 'queue_mock', 'test_error_details'] | None | {"Assign": 6, "Expr": 3, "With": 1} | 11 | 25 | 11 | ["MagicMock", "Exception", "str", "type", "TelemetryEvent", "patch.object", "patch.object", "mock_telemetry_client.record_error", "str", "type", "queue_mock.put_nowait.assert_called_once_with"] | 0 | [] | The function (test_record_error) defined within the public class called public.The function start at line 257 and ends at 281. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [257.0] and does not return any value. It declares 11.0 functions, and It has 11.0 f... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_prefixed_endpoint | def test_get_prefixed_endpoint(fresh_deadline_config,mock_telemetry_client: TelemetryClient,endpoint: str,prefix: str,expected_result: str,):"""Test that the _get_prefixed_endpoint function returns the expected prefixed endpoint"""assert mock_telemetry_client._get_prefixed_endpoint(endpoint, prefix) == expected_result | 1 | 8 | 5 | 34 | 0 | 307 | 315 | 307 | fresh_deadline_config,mock_telemetry_client,endpoint,prefix,expected_result | [] | None | {"Expr": 1} | 5 | 9 | 5 | ["mock_telemetry_client._get_prefixed_endpoint", "pytest.mark.parametrize", "pytest.param", "pytest.param", "pytest.param"] | 0 | [] | The function (test_get_prefixed_endpoint) defined within the public class called public.The function start at line 307 and ends at 315. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [307.0] and does not return any value. It declares 5.0 functions, and It has... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_record_decorator_success.successful | def successful():return | 1 | 2 | 0 | 5 | 0 | 341 | 342 | 341 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_record_decorator_success.successful) defined within the public class called public.The function start at line 341 and ends at 342. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_record_decorator_success | def test_record_decorator_success(fresh_deadline_config):"""Tests that recording a decorator successful metric"""with patch.object(api._telemetry, "get_deadline_endpoint_url", side_effect=["https://fake-endpoint-url"]):# GIVENqueue_mock = MagicMock()expected_summary: Dict[str, Any] = dict()expected_summary["is_success"... | 1 | 22 | 1 | 126 | 3 | 318 | 348 | 318 | fresh_deadline_config | ['expected_event', 'telemetry_client', 'queue_mock'] | None | {"AnnAssign": 1, "Assign": 7, "Expr": 3, "Return": 1, "With": 2} | 10 | 31 | 10 | ["patch.object", "MagicMock", "dict", "TelemetryEvent", "get_deadline_cloud_library_telemetry_client", "patch.object", "patch.object", "record_success_fail_telemetry_event", "successful", "queue_mock.put_nowait.assert_called_once_with"] | 0 | [] | The function (test_record_decorator_success) defined within the public class called public.The function start at line 318 and ends at 348. It contains 22 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 10.0 functions, and It ha... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_record_decorator_fails.fails | def fails():raise RuntimeError("foobar") | 1 | 2 | 0 | 9 | 0 | 375 | 376 | 375 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_record_decorator_fails.fails) defined within the public class called public.The function start at line 375 and ends at 376. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_record_decorator_fails | def test_record_decorator_fails(fresh_deadline_config):"""Tests that recording a decorator failed metric"""with patch.object(api._telemetry, "get_deadline_endpoint_url", side_effect=["https://fake-endpoint-url"]):# GIVENqueue_mock = MagicMock()expected_summary: Dict[str, Any] = dict()expected_summary["is_success"] = Fa... | 1 | 24 | 1 | 140 | 3 | 351 | 383 | 351 | fresh_deadline_config | ['expected_event', 'telemetry_client', 'queue_mock'] | None | {"AnnAssign": 1, "Assign": 8, "Expr": 3, "With": 3} | 12 | 33 | 12 | ["patch.object", "MagicMock", "dict", "TelemetryEvent", "get_deadline_cloud_library_telemetry_client", "patch.object", "patch.object", "RuntimeError", "record_success_fail_telemetry_event", "pytest.raises", "fails", "queue_mock.put_nowait.assert_called_once_with"] | 0 | [] | The function (test_record_decorator_fails) defined within the public class called public.The function start at line 351 and ends at 383. It contains 24 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 12.0 functions, and It has ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_latency_decorator.test_call | def test_call():return | 1 | 2 | 0 | 5 | 0 | 410 | 411 | 410 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_latency_decorator.test_call) defined within the public class called public.The function start at line 410 and ends at 411. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_latency_decorator | def test_latency_decorator(fresh_deadline_config):"""Tests that the latency recording decorator works"""with patch.object(api._telemetry, "get_deadline_endpoint_url", side_effect=["https://fake-endpoint-url"]), patch.object(time, "perf_counter_ns", return_value=0):# GIVENqueue_mock = MagicMock()expected_summary: Dict[s... | 1 | 23 | 1 | 145 | 3 | 386 | 417 | 386 | fresh_deadline_config | ['expected_event', 'telemetry_client', 'queue_mock'] | None | {"AnnAssign": 1, "Assign": 8, "Expr": 3, "Return": 1, "With": 2} | 11 | 32 | 11 | ["patch.object", "patch.object", "MagicMock", "dict", "TelemetryEvent", "get_deadline_cloud_library_telemetry_client", "patch.object", "patch.object", "record_function_latency_telemetry_event", "test_call", "queue_mock.put_nowait.assert_called_once_with"] | 0 | [] | The function (test_latency_decorator) defined within the public class called public.The function start at line 386 and ends at 417. It contains 23 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 11.0 functions, and It has 11.0 ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | get_minimal_json_job_template | def get_minimal_json_job_template(job_name):return json.dumps({"specificationVersion": "jobtemplate-2023-09","name": job_name,"parameterDefinitions": [{"name": "priority", "type": "INT", "default": 10},{"name": "sceneFile", "type": "STRING", "default": "/tmp/scene"},],"steps": [{"name": "CliScript","script": {"embedded... | 1 | 27 | 1 | 105 | 0 | 90 | 116 | 90 | job_name | [] | Returns | {"Return": 1} | 1 | 27 | 1 | ["json.dumps"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_bundle_submit_py.test_cli_bundle_job_name"] | The function (get_minimal_json_job_template) defined within the public class called public.The function start at line 90 and ends at 116. It contains 27 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declare 1.0 function, It has 1.0... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle | def test_create_job_from_job_bundle(fresh_deadline_config, temp_job_bundle_dir, job_template_case, parameters_case):"""Test a matrix of different job template and parameters file cases."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)config.set_setting("settin... | 2 | 44 | 4 | 215 | 1 | 294 | 349 | 294 | fresh_deadline_config,temp_job_bundle_dir,job_template_case,parameters_case | ['response'] | None | {"AnnAssign": 1, "Assign": 5, "Expr": 7, "If": 1, "With": 3} | 22 | 56 | 22 | ["config.set_setting", "config.set_setting", "config.set_setting", "patch_calls_for_create_job_from_job_bundle", "mock.get_boto3_client", "open", "os.path.join", "job_template_type.lower", "f.write", "open", "os.path.join", "parameters_type.lower", "f.write", "api.create_job_from_job_bundle", "dict", "expected_create_j... | 0 | [] | The function (test_create_job_from_job_bundle) defined within the public class called public.The function start at line 294 and ends at 349. It contains 44 lines of code and it has a cyclomatic complexity of 2. It takes 4 parameters, represented as [294.0] and does not return any value. It declares 22.0 functions, and ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_error_missing_template | def test_create_job_from_job_bundle_error_missing_template(fresh_deadline_config, temp_job_bundle_dir):"""Test a job bundle with missing template."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)with patch_calls_for_create_job_from_job_bundle():# Don't write a... | 1 | 15 | 2 | 88 | 0 | 352 | 375 | 352 | fresh_deadline_config,temp_job_bundle_dir | [] | None | {"Expr": 5, "With": 3} | 8 | 24 | 8 | ["config.set_setting", "config.set_setting", "patch_calls_for_create_job_from_job_bundle", "open", "os.path.join", "f.write", "pytest.raises", "api.create_job_from_job_bundle"] | 0 | [] | The function (test_create_job_from_job_bundle_error_missing_template) defined within the public class called public.The function start at line 352 and ends at 375. It contains 15 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [352.0] and does not return any value. It declar... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_error_duplicate_template | def test_create_job_from_job_bundle_error_duplicate_template(fresh_deadline_config, temp_job_bundle_dir):"""Test a job bundle with both a JSON and YAML template."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)with patch_calls_for_create_job_from_job_bundle():... | 1 | 19 | 2 | 158 | 0 | 378 | 405 | 378 | fresh_deadline_config,temp_job_bundle_dir | [] | None | {"Expr": 7, "With": 5} | 14 | 28 | 14 | ["config.set_setting", "config.set_setting", "patch_calls_for_create_job_from_job_bundle", "open", "os.path.join", "f.write", "open", "os.path.join", "f.write", "open", "os.path.join", "f.write", "pytest.raises", "api.create_job_from_job_bundle"] | 0 | [] | The function (test_create_job_from_job_bundle_error_duplicate_template) defined within the public class called public.The function start at line 378 and ends at 405. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [378.0] and does not return any value. It decl... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_error_duplicate_parameters | def test_create_job_from_job_bundle_error_duplicate_parameters(fresh_deadline_config, temp_job_bundle_dir):"""Test a job bundle with an incorrect AWS Deadline Cloud parameter"""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)with patch_calls_for_create_job_from_... | 1 | 17 | 2 | 117 | 0 | 408 | 433 | 408 | fresh_deadline_config,temp_job_bundle_dir | [] | None | {"Expr": 6, "With": 4} | 11 | 26 | 11 | ["config.set_setting", "config.set_setting", "patch_calls_for_create_job_from_job_bundle", "open", "os.path.join", "f.write", "open", "os.path.join", "f.write", "pytest.raises", "api.create_job_from_job_bundle"] | 0 | [] | The function (test_create_job_from_job_bundle_error_duplicate_parameters) defined within the public class called public.The function start at line 408 and ends at 433. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [408.0] and does not return any value. It de... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_job_attachments.fake_hashing_callback | def fake_hashing_callback(metadata: ProgressReportMetadata) -> bool:return True | 1 | 2 | 1 | 11 | 0 | 476 | 477 | 476 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_create_job_from_job_bundle_job_attachments.fake_hashing_callback) defined within the public class called public.The function start at line 476 and ends at 477. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_job_attachments.fake_upload_callback | def fake_upload_callback(metadata: ProgressReportMetadata) -> bool:return True | 1 | 2 | 1 | 11 | 0 | 479 | 480 | 479 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_create_job_from_job_bundle_job_attachments.fake_upload_callback) defined within the public class called public.The function start at line 479 and ends at 480. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_job_attachments | def test_create_job_from_job_bundle_job_attachments(fresh_deadline_config, temp_job_bundle_dir, temp_assets_dir):"""Test a job bundle with asset references."""with patch_calls_for_create_job_from_job_bundle() as mock:mock.get_boto3_client().get_storage_profile_for_queue.return_value = (MOCK_GET_STORAGE_PROFILE_FOR_QUEU... | 2 | 77 | 3 | 418 | 3 | 436 | 529 | 436 | fresh_deadline_config,temp_job_bundle_dir,temp_assets_dir | ['asset_references', 'mock_telemetry_client', 'asset_contents'] | Returns | {"Assign": 4, "Expr": 10, "Return": 2, "With": 3} | 26 | 94 | 26 | ["patch_calls_for_create_job_from_job_bundle", "mock.get_boto3_client", "config.set_setting", "config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "write_test_asset_files", "os.path.join", "os.path.join", "os.path.join", "open", "os.path.join", "json.dump", "api.create_job_from_job_bundle", "m... | 0 | [] | The function (test_create_job_from_job_bundle_job_attachments) defined within the public class called public.The function start at line 436 and ends at 529. It contains 77 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [436.0], and this function return a value. It declares ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_empty_job_attachments.fake_hashing_callback | def fake_hashing_callback(metadata: ProgressReportMetadata) -> bool:return True | 1 | 2 | 1 | 11 | 0 | 580 | 581 | 580 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_create_job_from_job_bundle_empty_job_attachments.fake_hashing_callback) defined within the public class called public.The function start at line 580 and ends at 581. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_empty_job_attachments.fake_upload_callback | def fake_upload_callback(metadata: ProgressReportMetadata) -> bool:return True | 1 | 2 | 1 | 11 | 0 | 583 | 584 | 583 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_create_job_from_job_bundle_empty_job_attachments.fake_upload_callback) defined within the public class called public.The function start at line 583 and ends at 584. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any v... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_empty_job_attachments | def test_create_job_from_job_bundle_empty_job_attachments(fresh_deadline_config, temp_job_bundle_dir, temp_assets_dir):"""Test that when we have asset references that do not fall under Job Attachments(for example, if under a SHARED Storage Profile Filesystem Location), no JobAttachments calls are made."""config.set_set... | 1 | 66 | 3 | 391 | 3 | 532 | 618 | 532 | fresh_deadline_config,temp_job_bundle_dir,temp_assets_dir | ['asset_references', 'expected_upload_group', 'asset_contents'] | Returns | {"Assign": 5, "Expr": 12, "Return": 2, "With": 3} | 30 | 87 | 30 | ["config.set_setting", "config.set_setting", "config.set_setting", "patch_calls_for_create_job_from_job_bundle", "patch.object", "mock.get_boto3_client", "AssetUploadGroup", "open", "os.path.join", "f.write", "write_test_asset_files", "os.path.join", "os.path.join", "os.path.join", "open", "os.path.join", "json.dump", ... | 0 | [] | The function (test_create_job_from_job_bundle_empty_job_attachments) defined within the public class called public.The function start at line 532 and ends at 618. It contains 66 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [532.0], and this function return a value. It dec... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_with_empty_asset_references | def test_create_job_from_job_bundle_with_empty_asset_references(fresh_deadline_config, temp_job_bundle_dir):"""Test a job bundle with an asset_references file but no referenced files."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)config.set_setting("settings... | 1 | 38 | 2 | 210 | 1 | 621 | 670 | 621 | fresh_deadline_config,temp_job_bundle_dir | ['response'] | None | {"AnnAssign": 1, "Assign": 3, "Expr": 7, "With": 3} | 15 | 50 | 15 | ["config.set_setting", "config.set_setting", "config.set_setting", "patch_calls_for_create_job_from_job_bundle", "mock.get_boto3_client", "open", "os.path.join", "job_template_type.lower", "f.write", "open", "os.path.join", "json.dump", "api.create_job_from_job_bundle", "create_job.assert_called_once_with", "mock.get_b... | 0 | [] | The function (test_create_job_from_job_bundle_with_empty_asset_references) defined within the public class called public.The function start at line 621 and ends at 670. It contains 38 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [621.0] and does not return any value. It d... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_partially_empty_directories | def test_create_job_from_job_bundle_partially_empty_directories(fresh_deadline_config, temp_job_bundle_dir):"""Test a job bundle with an input directory that contains both empty directories and input filesdoes not throw a MisconfiguredInputsError and successfully submits"""config.set_setting("defaults.farm_id", MOCK_FA... | 1 | 31 | 2 | 201 | 3 | 673 | 717 | 673 | fresh_deadline_config,temp_job_bundle_dir | ['temp_bundle_dir_as_path', 'empty_directory', 'response'] | None | {"AnnAssign": 2, "Assign": 4, "Expr": 7, "With": 3} | 17 | 45 | 17 | ["config.set_setting", "config.set_setting", "Path", "str", "str", "mkdir", "Path", "touch", "patch_calls_for_create_job_from_job_bundle", "open", "os.path.join", "job_template_type.lower", "f.write", "open", "os.path.join", "json.dump", "api.create_job_from_job_bundle"] | 0 | [] | The function (test_create_job_from_job_bundle_partially_empty_directories) defined within the public class called public.The function start at line 673 and ends at 717. It contains 31 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [673.0] and does not return any value. It d... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_misconfigured_directories | def test_create_job_from_job_bundle_misconfigured_directories(fresh_deadline_config, temp_job_bundle_dir, caplog):"""Test that a submitting a job with the `require_paths_exist` flag set to truewith a job bundle with input directories that do not exist throws an error.Also confirms that empty directories as logged and a... | 1 | 35 | 3 | 228 | 3 | 720 | 768 | 720 | fresh_deadline_config,temp_job_bundle_dir,caplog | ['temp_bundle_dir_as_path', 'missing_directory', 'empty_directory'] | None | {"AnnAssign": 1, "Assign": 4, "Expr": 8, "With": 4} | 20 | 49 | 20 | ["config.set_setting", "config.set_setting", "Path", "str", "str", "mkdir", "Path", "patch_calls_for_create_job_from_job_bundle", "caplog.set_level", "open", "os.path.join", "job_template_type.lower", "f.write", "open", "os.path.join", "json.dump", "pytest.raises", "api.create_job_from_job_bundle", "str", "str"] | 0 | [] | The function (test_create_job_from_job_bundle_misconfigured_directories) defined within the public class called public.The function start at line 720 and ends at 768. It contains 35 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [720.0] and does not return any value. It dec... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_misconfigured_input_files | def test_create_job_from_job_bundle_misconfigured_input_files(fresh_deadline_config, temp_job_bundle_dir, caplog):"""Test that a submitting a job without the `require_paths_exist` flag set,with a job bundle with input directories that do not exist does not include thosedirectories in the warning message, but DOES incld... | 1 | 37 | 3 | 223 | 3 | 771 | 822 | 771 | fresh_deadline_config,temp_job_bundle_dir,caplog | ['temp_bundle_dir_as_path', 'directory_pretending_to_be_file', 'missing_file'] | None | {"AnnAssign": 1, "Assign": 4, "Expr": 8, "With": 4} | 20 | 52 | 20 | ["config.set_setting", "config.set_setting", "Path", "str", "str", "mkdir", "Path", "patch_calls_for_create_job_from_job_bundle", "caplog.set_level", "open", "os.path.join", "job_template_type.lower", "f.write", "open", "os.path.join", "json.dump", "pytest.raises", "api.create_job_from_job_bundle", "str", "str"] | 0 | [] | The function (test_create_job_from_job_bundle_misconfigured_input_files) defined within the public class called public.The function start at line 771 and ends at 822. It contains 37 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [771.0] and does not return any value. It dec... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_with_single_asset_file.fake_hashing_callback | def fake_hashing_callback(metadata: ProgressReportMetadata) -> bool:return True | 1 | 2 | 1 | 11 | 0 | 862 | 863 | 862 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_create_job_from_job_bundle_with_single_asset_file.fake_hashing_callback) defined within the public class called public.The function start at line 862 and ends at 863. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_with_single_asset_file.fake_upload_callback | def fake_upload_callback(metadata: ProgressReportMetadata) -> bool:return True | 1 | 2 | 1 | 11 | 0 | 865 | 866 | 865 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_create_job_from_job_bundle_with_single_asset_file.fake_upload_callback) defined within the public class called public.The function start at line 865 and ends at 866. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_with_single_asset_file | def test_create_job_from_job_bundle_with_single_asset_file(fresh_deadline_config, temp_job_bundle_dir, temp_assets_dir):"""Test a job bundle with a single input file reference and no output directories."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)config.se... | 1 | 69 | 3 | 328 | 2 | 825 | 912 | 825 | fresh_deadline_config,temp_job_bundle_dir,temp_assets_dir | ['asset_references', 'asset_contents'] | Returns | {"Assign": 3, "Expr": 9, "Return": 2, "With": 3} | 19 | 88 | 19 | ["config.set_setting", "config.set_setting", "config.set_setting", "patch_calls_for_create_job_from_job_bundle", "mock.get_boto3_client", "open", "os.path.join", "f.write", "write_test_asset_files", "os.path.join", "open", "os.path.join", "json.dump", "api.create_job_from_job_bundle", "mock.hash_attachments.assert_call... | 0 | [] | The function (test_create_job_from_job_bundle_with_single_asset_file) defined within the public class called public.The function start at line 825 and ends at 912. It contains 69 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [825.0], and this function return a value. It de... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_with_target_task_run_status | def test_create_job_from_job_bundle_with_target_task_run_status(fresh_deadline_config,temp_job_bundle_dir,):"""Test that create_job_from_job_bundle passes the target_task_run_status parameter to create_job."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)# Cre... | 1 | 17 | 2 | 102 | 1 | 915 | 939 | 915 | fresh_deadline_config,temp_job_bundle_dir | ['create_job_call'] | None | {"Assign": 1, "Expr": 5, "With": 2} | 8 | 25 | 8 | ["config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "patch_calls_for_create_job_from_job_bundle", "api.create_job_from_job_bundle", "mock.get_boto3_client"] | 0 | [] | The function (test_create_job_from_job_bundle_with_target_task_run_status) defined within the public class called public.The function start at line 915 and ends at 939. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [915.0] and does not return any value. It d... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_without_target_task_run_status | def test_create_job_from_job_bundle_without_target_task_run_status(fresh_deadline_config,temp_job_bundle_dir,):"""Test that create_job_from_job_bundle does not pass targetTaskRunStatus when not specified."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)# Creat... | 1 | 16 | 2 | 96 | 1 | 942 | 965 | 942 | fresh_deadline_config,temp_job_bundle_dir | ['create_job_call'] | None | {"Assign": 1, "Expr": 5, "With": 2} | 8 | 24 | 8 | ["config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "patch_calls_for_create_job_from_job_bundle", "api.create_job_from_job_bundle", "mock.get_boto3_client"] | 0 | [] | The function (test_create_job_from_job_bundle_without_target_task_run_status) defined within the public class called public.The function start at line 942 and ends at 965. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [942.0] and does not return any value. I... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_create_job_to_complete.mock_continue_callback | def mock_continue_callback() -> bool:return True | 1 | 2 | 0 | 8 | 0 | 1,003 | 1,004 | 1,003 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_wait_for_create_job_to_complete.mock_continue_callback) defined within the public class called public.The function start at line 1003 and ends at 1004. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_create_job_to_complete | def test_wait_for_create_job_to_complete(responses, final_status):"""Test the waiter for calling CreateJob."""def mock_continue_callback() -> bool:return Truedeadline_client = Mock()deadline_client.get_job.side_effect = [{"lifecycleStatus": response,"lifecycleStatusMessage": MOCK_STATUS_MESSAGE,}for response in respons... | 2 | 20 | 2 | 84 | 1 | 998 | 1,025 | 998 | responses,final_status | ['deadline_client'] | Returns | {"Assign": 3, "Expr": 1, "Return": 1, "With": 1} | 4 | 28 | 4 | ["Mock", "patch.object", "api.wait_for_create_job_to_complete", "pytest.mark.parametrize"] | 0 | [] | The function (test_wait_for_create_job_to_complete) defined within the public class called public.The function start at line 998 and ends at 1025. It contains 20 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [998.0], and this function return a value. It declares 4.0 functi... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_create_job_to_complete_timeout.mock_continue_callback | def mock_continue_callback() -> bool:return True | 1 | 2 | 0 | 8 | 0 | 1,033 | 1,034 | 1,033 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_wait_for_create_job_to_complete_timeout.mock_continue_callback) defined within the public class called public.The function start at line 1033 and ends at 1034. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_create_job_to_complete_timeout | def test_wait_for_create_job_to_complete_timeout():"""Test the waiter for calling CreateJob when it times out."""def mock_continue_callback() -> bool:return Truedeadline_client = Mock()deadline_client.get_job.return_value = {"state": "CREATE_IN_PROGRESS","lifecycleStatusMessage": MOCK_STATUS_MESSAGE,}# Mock time.time t... | 1 | 30 | 0 | 127 | 2 | 1,028 | 1,065 | 1,028 | ['mock_times', 'deadline_client'] | Returns | {"Assign": 3, "Expr": 2, "Return": 1, "With": 1} | 5 | 38 | 5 | ["Mock", "pytest.raises", "patch.object", "patch.object", "api.wait_for_create_job_to_complete"] | 0 | [] | The function (test_wait_for_create_job_to_complete_timeout) defined within the public class called public.The function start at line 1028 and ends at 1065. It contains 30 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 5.0 f... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_with_not_valid_directory_path | def test_create_job_from_job_bundle_with_not_valid_directory_path(fresh_deadline_config, temp_job_bundle_dir, temp_assets_dir, template, parameter_key, file_path):"""Tests that a job bundle with template that contains either absolute paths or relative paths that resolveoutside of the Job Bundle directory throws a Deadl... | 1 | 19 | 6 | 161 | 2 | 211 | 241 | 211 | fresh_deadline_config,temp_job_bundle_dir,temp_assets_dir,template,parameter_key,file_path | ['job_template_replaced', 'job_bundle_absolute_dir_path'] | None | {"Assign": 5, "Expr": 3, "With": 3} | 18 | 31 | 18 | ["os.path.normpath", "template.replace", "open", "os.path.join", "f.write", "patch.object", "patch.object", "patch.object", "client_mock", "client_mock", "client_mock", "pytest.raises", "api.create_job_from_job_bundle", "pytest.mark.parametrize", "pytest.param", "pytest.param", "pytest.param", "pytest.param"] | 0 | [] | The function (test_create_job_from_job_bundle_with_not_valid_directory_path) defined within the public class called public.The function start at line 211 and ends at 241. It contains 19 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [211.0] and does not return any value. It... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_create_job_from_job_bundle_with_all_asset_ref_variants | def test_create_job_from_job_bundle_with_all_asset_ref_variants(fresh_deadline_config, temp_job_bundle_dir, temp_assets_dir, temp_cwd):"""Test a job bundle with template from JOB_TEMPLATE_ALL_ASSET_REF_VARIANTS."""# Use a temporary directory for the job bundlewith patch.object(_submit_job_bundle.api, "get_boto3_session... | 1 | 196 | 4 | 1,036 | 1 | 244 | 461 | 244 | fresh_deadline_config,temp_job_bundle_dir,temp_assets_dir,temp_cwd | ['job_parameters'] | None | {"Assign": 6, "Expr": 9, "With": 2} | 73 | 218 | 73 | ["patch.object", "patch.object", "patch.object", "patch.object", "patch.object", "patch.object", "client_mock", "client_mock", "client_mock", "SummaryStatistics", "AssetRootManifest", "SummaryStatistics", "Attachments", "ManifestProperties", "config.set_setting", "config.set_setting", "open", "os.path.join", "f.write",... | 0 | [] | The function (test_create_job_from_job_bundle_with_all_asset_ref_variants) defined within the public class called public.The function start at line 244 and ends at 461. It contains 196 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [244.0] and does not return any value. It ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_success | def test_wait_for_job_completion_success():"""Test that wait_for_job_completion works correctly when job succeeds."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client:deadline_mock = MagicMock()mock_get_client.return_value = deadline_mock# First call returns RUNNING, second call retu... | 1 | 23 | 0 | 169 | 4 | 97 | 132 | 97 | ['start_time', 'result', 'deadline_mock', 'end_time'] | None | {"Assign": 7, "Expr": 2, "With": 3} | 11 | 36 | 11 | ["patch", "MagicMock", "patch", "datetime.datetime", "datetime.datetime", "patch", "wait_for_job_completion", "isinstance", "pytest.approx", "len", "deadline_mock.get_job.assert_called_with"] | 0 | [] | The function (test_wait_for_job_completion_success) defined within the public class called public.The function start at line 97 and ends at 132. It contains 23 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 11.0 functions, and ... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_failure.get_paginator_side_effect | def get_paginator_side_effect(operation):if operation == "list_steps":return steps_paginator_mockelif operation == "list_tasks":return tasks_paginator_mockreturn MagicMock() | 3 | 6 | 1 | 23 | 0 | 155 | 160 | 155 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_wait_for_job_completion_failure.get_paginator_side_effect) defined within the public class called public.The function start at line 155 and ends at 160. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_failure | def test_wait_for_job_completion_failure():"""Test that wait_for_job_completion works correctly when job fails."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client:deadline_mock = MagicMock()mock_get_client.return_value = deadline_mock# First call returns RUNNING, second call returns... | 1 | 42 | 0 | 332 | 6 | 135 | 205 | 135 | ['tasks_paginator_mock', 'end_time', 'result', 'deadline_mock', 'start_time', 'steps_paginator_mock'] | Returns | {"Assign": 12, "Expr": 5, "If": 2, "Return": 3, "With": 3} | 17 | 71 | 17 | ["patch", "MagicMock", "MagicMock", "MagicMock", "MagicMock", "patch", "datetime.datetime", "datetime.datetime", "patch", "wait_for_job_completion", "isinstance", "pytest.approx", "len", "deadline_mock.get_paginator.assert_any_call", "steps_paginator_mock.paginate.assert_called_with", "deadline_mock.get_paginator.asser... | 0 | [] | The function (test_wait_for_job_completion_failure) defined within the public class called public.The function start at line 135 and ends at 205. It contains 42 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 17.0 functions,... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_timeout | def test_wait_for_job_completion_timeout():"""Test that wait_for_job_completion times out correctly."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client:deadline_mock = MagicMock()mock_get_client.return_value = deadline_mock# Always return RUNNING to trigger timeoutdeadline_mock.get_... | 2 | 22 | 0 | 150 | 3 | 208 | 239 | 208 | ['start_time', 'deadline_mock', 'check_time'] | None | {"Assign": 6, "Expr": 2, "Try": 1, "With": 4} | 9 | 32 | 9 | ["patch", "MagicMock", "patch", "datetime.datetime", "datetime.datetime", "patch", "patch.object", "wait_for_job_completion", "str"] | 0 | [] | The function (test_wait_for_job_completion_timeout) defined within the public class called public.The function start at line 208 and ends at 239. It contains 22 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 9.0 functions, and ... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_with_pagination.get_paginator_side_effect | def get_paginator_side_effect(operation):if operation == "list_steps":return steps_paginator_mockelif operation == "list_tasks":return tasks_paginator_mockreturn MagicMock() | 3 | 6 | 1 | 23 | 0 | 266 | 271 | 266 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_wait_for_job_completion_with_pagination.get_paginator_side_effect) defined within the public class called public.The function start at line 266 and ends at 271. It contains 6 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_with_pagination | def test_wait_for_job_completion_with_pagination():"""Test that wait_for_job_completion correctly handles pagination for steps and tasks."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client:deadline_mock = MagicMock()mock_get_client.return_value = deadline_mock# Return FAILED job sta... | 1 | 38 | 0 | 312 | 10 | 242 | 305 | 242 | ['tasks_paginator_mock', 'end_time', 'result', 'tasks_page1', 'tasks_page2', 'deadline_mock', 'steps_page2', 'steps_page1', 'steps_paginator_mock', 'start_time'] | Returns | {"Assign": 16, "Expr": 5, "If": 2, "Return": 3, "With": 3} | 17 | 64 | 17 | ["patch", "MagicMock", "MagicMock", "MagicMock", "MagicMock", "patch", "datetime.datetime", "datetime.datetime", "patch", "wait_for_job_completion", "isinstance", "pytest.approx", "len", "deadline_mock.get_paginator.assert_any_call", "steps_paginator_mock.paginate.assert_called_with", "deadline_mock.get_paginator.asser... | 0 | [] | The function (test_wait_for_job_completion_with_pagination) defined within the public class called public.The function start at line 242 and ends at 305. It contains 38 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 17.0 fu... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_exponential_backoff.mock_sleep | def mock_sleep(interval):sleep_intervals.append(interval) | 1 | 2 | 1 | 11 | 0 | 351 | 352 | 351 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_wait_for_job_completion_exponential_backoff.mock_sleep) defined within the public class called public.The function start at line 351 and ends at 352. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_exponential_backoff | def test_wait_for_job_completion_exponential_backoff():"""Test that wait_for_job_completion uses exponential backoff correctly."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client:deadline_mock = MagicMock()mock_get_client.return_value = deadline_mock# Return RUNNING for several call... | 1 | 29 | 0 | 198 | 5 | 332 | 376 | 332 | ['end_time', 'sleep_intervals', 'deadline_mock', 'start_time', 'result'] | None | {"Assign": 8, "Expr": 2, "With": 3} | 14 | 45 | 14 | ["patch", "MagicMock", "sleep_intervals.append", "patch", "datetime.datetime", "datetime.datetime", "patch", "wait_for_job_completion", "isinstance", "len", "pytest.approx", "pytest.approx", "pytest.approx", "pytest.approx"] | 0 | [] | The function (test_wait_for_job_completion_exponential_backoff) defined within the public class called public.The function start at line 332 and ends at 376. It contains 29 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 14.0 fu... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_max_interval_cap.mock_sleep | def mock_sleep(interval):sleep_intervals.append(interval) | 1 | 2 | 1 | 11 | 0 | 393 | 394 | 393 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_wait_for_job_completion_max_interval_cap.mock_sleep) defined within the public class called public.The function start at line 393 and ends at 394. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_wait_for_job_completion_max_interval_cap | def test_wait_for_job_completion_max_interval_cap():"""Test that wait_for_job_completion caps at max_poll_interval."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client:deadline_mock = MagicMock()mock_get_client.return_value = deadline_mock# Return RUNNING for many calls, then SUCCEED... | 2 | 26 | 0 | 216 | 5 | 379 | 421 | 379 | ['end_time', 'sleep_intervals', 'deadline_mock', 'start_time', 'result'] | None | {"Assign": 8, "Expr": 2, "For": 1, "With": 3} | 15 | 43 | 15 | ["patch", "MagicMock", "sleep_intervals.append", "patch", "datetime.datetime", "datetime.datetime", "patch", "wait_for_job_completion", "isinstance", "len", "pytest.approx", "pytest.approx", "pytest.approx", "range", "pytest.approx"] | 0 | [] | The function (test_wait_for_job_completion_max_interval_cap) defined within the public class called public.The function start at line 379 and ends at 421. It contains 26 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 15.0 funct... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_session_logs_basic | def test_get_session_logs_basic():"""Test that get_session_logs works correctly with basic parameters."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client, patch("deadline.client.api._job_monitoring.get_user_and_identity_store_id") as mock_get_user:# Mock user and identity store ID t... | 1 | 28 | 0 | 154 | 2 | 424 | 463 | 424 | ['result', 'logs_client_mock'] | None | {"Assign": 5, "Expr": 2, "With": 1} | 7 | 40 | 7 | ["patch", "patch", "MagicMock", "get_session_logs", "isinstance", "len", "logs_client_mock.get_log_events.assert_called_once_with"] | 0 | [] | The function (test_get_session_logs_basic) defined within the public class called public.The function start at line 424 and ends at 463. It contains 28 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 7.0 functions, and It has 7... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_session_logs_with_datetime_params | def test_get_session_logs_with_datetime_params():"""Test that get_session_logs works correctly with datetime parameters."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client, patch("deadline.client.api._job_monitoring.get_user_and_identity_store_id") as mock_get_user:# Mock user and i... | 1 | 28 | 0 | 177 | 4 | 466 | 507 | 466 | ['start_time', 'result', 'end_time', 'logs_client_mock'] | None | {"Assign": 7, "Expr": 2, "With": 1} | 13 | 42 | 13 | ["patch", "patch", "MagicMock", "datetime.datetime", "datetime.datetime", "get_session_logs", "isinstance", "len", "logs_client_mock.get_log_events.assert_called_once_with", "int", "start_time.timestamp", "int", "end_time.timestamp"] | 0 | [] | The function (test_get_session_logs_with_datetime_params) defined within the public class called public.The function start at line 466 and ends at 507. It contains 28 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 13.0 function... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_session_logs_with_monitor_credentials | def test_get_session_logs_with_monitor_credentials():"""Test that get_session_logs works correctly with Deadline Cloud monitor credentials."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client, patch("deadline.client.api._job_monitoring.get_user_and_identity_store_id") as mock_get_use... | 1 | 35 | 0 | 165 | 4 | 510 | 562 | 510 | ['result', 'queue_session_mock', 'deadline_mock', 'logs_client_mock'] | None | {"Assign": 9, "Expr": 4, "With": 1} | 12 | 53 | 12 | ["patch", "patch", "patch", "MagicMock", "MagicMock", "MagicMock", "get_session_logs", "isinstance", "len", "mock_get_session.assert_called_once_with", "queue_session_mock.client.assert_called_once_with", "logs_client_mock.get_log_events.assert_called_once_with"] | 0 | [] | The function (test_get_session_logs_with_monitor_credentials) defined within the public class called public.The function start at line 510 and ends at 562. It contains 35 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 12.0 func... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_session_logs_with_next_token | def test_get_session_logs_with_next_token():"""Test that get_session_logs works correctly with pagination token."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client, patch("deadline.client.api._job_monitoring.get_user_and_identity_store_id") as mock_get_user:# Mock user and identity ... | 1 | 24 | 0 | 112 | 2 | 565 | 600 | 565 | ['result', 'logs_client_mock'] | None | {"Assign": 5, "Expr": 2, "With": 1} | 6 | 36 | 6 | ["patch", "patch", "MagicMock", "get_session_logs", "isinstance", "logs_client_mock.get_log_events.assert_called_once_with"] | 0 | [] | The function (test_get_session_logs_with_next_token) defined within the public class called public.The function start at line 565 and ends at 600. It contains 24 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_session_logs_resource_not_found | def test_get_session_logs_resource_not_found():"""Test that get_session_logs handles ResourceNotFoundException correctly."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client, patch("deadline.client.api._job_monitoring.get_user_and_identity_store_id") as mock_get_user:# Mock user and ... | 1 | 25 | 0 | 134 | 2 | 603 | 637 | 603 | ['result', 'logs_client_mock'] | None | {"Assign": 6, "Expr": 1, "With": 1} | 8 | 35 | 8 | ["patch", "patch", "MagicMock", "type", "logs_client_mock.exceptions.ResourceNotFoundException", "get_session_logs", "isinstance", "len"] | 0 | [] | The function (test_get_session_logs_resource_not_found) defined within the public class called public.The function start at line 603 and ends at 637. It contains 25 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 8.0 functions, ... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_get_session_logs_invalid_datetime | def test_get_session_logs_invalid_datetime():"""Test that get_session_logs handles invalid datetime objects correctly."""with patch("deadline.client.api._job_monitoring.get_boto3_client") as mock_get_client, patch("deadline.client.api._job_monitoring.get_user_and_identity_store_id") as mock_get_user:# Mock user and ide... | 2 | 21 | 0 | 91 | 2 | 640 | 670 | 640 | ['invalid_datetime', 'logs_client_mock'] | None | {"Assign": 5, "Expr": 2, "Try": 1, "With": 1} | 7 | 31 | 7 | ["patch", "patch", "MagicMock", "MagicMock", "AttributeError", "get_session_logs", "str"] | 0 | [] | The function (test_get_session_logs_invalid_datetime) defined within the public class called public.The function start at line 640 and ends at 670. It contains 21 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 7.0 functions, an... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | mock_boto3_session | def mock_boto3_session():"""Create a mock boto3 session for tests."""session = MagicMock()session.client.return_value = MagicMock()return session | 1 | 4 | 0 | 21 | 1 | 24 | 28 | 24 | ['session'] | Returns | {"Assign": 2, "Expr": 1, "Return": 1} | 2 | 5 | 2 | ["MagicMock", "MagicMock"] | 0 | [] | The function (mock_boto3_session) defined within the public class called public.The function start at line 24 and ends at 28. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters, and this function return a value. It declares 2.0 functions, and It has 2.0 funct... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_list_jobs_by_filter_with_incorrect_filter_expression | def test_list_jobs_by_filter_with_incorrect_filter_expression(mock_boto3_session):"""Test parameter validation of the timestamp"""# Mock SearchJobs to assert it wasn't calledmock_boto3_session.client().search_jobs.return_value = {}# Test when both timestamp and look_back_duration are missingwith pytest.raises(ValueErro... | 1 | 20 | 1 | 99 | 0 | 31 | 57 | 31 | mock_boto3_session | [] | None | {"Assign": 1, "Expr": 3, "With": 2} | 7 | 27 | 7 | ["mock_boto3_session.client", "pytest.raises", "_list_jobs_by_filter_expression", "str", "pytest.raises", "_list_jobs_by_filter_expression", "str"] | 0 | [] | The function (test_list_jobs_by_filter_with_incorrect_filter_expression) defined within the public class called public.The function start at line 31 and ends at 57. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_list_jobs_recent_jobs_timestamp | def test_list_jobs_recent_jobs_timestamp(fresh_deadline_config,mock_boto3_session,use_look_back,timestamp_field_name,job_count,expected_call_count,):"""Test cases calling with with a matrix of variations"""updated_at_min = datetime(2025, 1, 1, tzinfo=timezone.utc)updated_at_max = datetime(2025, 1, 1, 23, tzinfo=timezon... | 1 | 34 | 6 | 181 | 5 | 80 | 119 | 80 | fresh_deadline_config,mock_boto3_session,use_look_back,timestamp_field_name,job_count,expected_call_count | ['updated_at_max', 'mock_search_jobs', 'updated_at_min', 'result', 'jobs'] | None | {"Assign": 6, "Expr": 1} | 14 | 40 | 14 | ["datetime", "datetime", "create_fake_job_list", "MagicMock", "mock_search_jobs_for_set", "mock_boto3_session.client", "_list_jobs_by_filter_expression", "upper", "timestamp_field_name.replace", "sorted", "sorted", "pytest.mark.parametrize", "pytest.mark.parametrize", "pytest.mark.parametrize"] | 0 | [] | The function (test_list_jobs_recent_jobs_timestamp) defined within the public class called public.The function start at line 80 and ends at 119. It contains 34 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [80.0] and does not return any value. It declares 14.0 functions, a... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_list_jobs_recent_jobs_timestamp_partial_jobs_return | def test_list_jobs_recent_jobs_timestamp_partial_jobs_return(fresh_deadline_config, mock_boto3_session):"""Test cases calling with timestamp parameter, where it's somewhere in the middle of the timestamp range"""updated_at_min = datetime(2025, 1, 1, tzinfo=timezone.utc)updated_at_max = datetime(2025, 1, 1, 23, tzinfo=t... | 5 | 34 | 2 | 224 | 9 | 122 | 165 | 122 | fresh_deadline_config,mock_boto3_session | ['updated_at_max', 'random_micros', 'filtered_jobs', 'updated_at_micros_range', 'updated_at_filter', 'mock_search_jobs', 'updated_at_min', 'result', 'jobs'] | None | {"Assign": 10, "Expr": 2, "For": 1} | 15 | 44 | 15 | ["datetime", "datetime", "int", "total_seconds", "create_fake_job_list", "MagicMock", "mock_search_jobs_for_set", "mock_boto3_session.client", "range", "mock_search_jobs.reset_mock", "randrange", "timedelta", "_list_jobs_by_filter_expression", "sorted", "sorted"] | 0 | [] | The function (test_list_jobs_recent_jobs_timestamp_partial_jobs_return) defined within the public class called public.The function start at line 122 and ends at 165. It contains 34 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [122.0] and does not return any value. It decl... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_list_jobs_recent_edge_case_many_equal_timestamps | def test_list_jobs_recent_edge_case_many_equal_timestamps(fresh_deadline_config, mock_boto3_session):"""Test edge case when there are > 100 exactly equal timestamps."""updated_at_min = datetime(2025, 1, 1, tzinfo=timezone.utc)updated_at_max = datetime(2025, 1, 1, 23, tzinfo=timezone.utc)# Repeat the midpoint a bunch of... | 1 | 38 | 2 | 242 | 5 | 168 | 219 | 168 | fresh_deadline_config,mock_boto3_session | ['updated_at_max', 'updated_at_repeated', 'mock_search_jobs', 'updated_at_min', 'jobs'] | None | {"Assign": 6, "Expr": 3, "With": 1} | 13 | 52 | 13 | ["datetime", "datetime", "create_fake_job_list", "jobs.extend", "create_fake_job_list", "MagicMock", "mock_search_jobs_for_set", "mock_boto3_session.client", "pytest.raises", "_list_jobs_by_filter_expression", "str", "len", "len"] | 0 | [] | The function (test_list_jobs_recent_edge_case_many_equal_timestamps) defined within the public class called public.The function start at line 168 and ends at 219. It contains 38 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [168.0] and does not return any value. It declare... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_list_jobs_by_filter_expression | def test_list_jobs_by_filter_expression(fresh_deadline_config,mock_boto3_session,job_count,):"""Test cases calling with with a matrix of variations"""test_status_values = ["READY", "ASSIGNED", "STARTING"]jobs = sorted(create_fake_job_list(job_count), key=lambda job: job["jobId"])# Create the fake deadline:SearchJobs AP... | 4 | 30 | 3 | 147 | 4 | 223 | 260 | 223 | fresh_deadline_config,mock_boto3_session,job_count | ['mock_search_jobs', 'result', 'test_status_values', 'jobs'] | None | {"Assign": 5, "Expr": 1} | 8 | 38 | 8 | ["sorted", "create_fake_job_list", "MagicMock", "mock_search_jobs_for_set", "mock_boto3_session.client", "_list_jobs_by_filter_expression", "sorted", "pytest.mark.parametrize"] | 0 | [] | The function (test_list_jobs_by_filter_expression) defined within the public class called public.The function start at line 223 and ends at 260. It contains 30 lines of code and it has a cyclomatic complexity of 4. It takes 3 parameters, represented as [223.0] and does not return any value. It declares 8.0 functions, a... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | mock_boto3_client | def mock_boto3_client():"""Mock the boto3 client."""with mock.patch("deadline.client.api._session.get_boto3_client") as mock_get_client:mock_client = mock.MagicMock()mock_get_client.return_value = mock_clientyield mock_client | 1 | 5 | 0 | 29 | 1 | 15 | 20 | 15 | ['mock_client'] | None | {"Assign": 2, "Expr": 2, "With": 1} | 2 | 6 | 2 | ["mock.patch", "mock.MagicMock"] | 0 | [] | The function (mock_boto3_client) defined within the public class called public.The function start at line 15 and ends at 20. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 2.0 functions, and It has 2.0 functions ... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_assume_queue_role_for_user | def test_assume_queue_role_for_user(mock_boto3_client):"""Test assuming user role for a queue."""# Setupexpiration = datetime.datetime(2025, 4, 8, 20, 0, 46)mock_boto3_client.assume_queue_role_for_user.return_value = {"Credentials": {"AccessKeyId": "ASIAEXAMPLE","SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLE... | 1 | 20 | 1 | 120 | 2 | 23 | 48 | 23 | mock_boto3_client | ['result', 'expiration'] | None | {"Assign": 3, "Expr": 2} | 3 | 26 | 3 | ["datetime.datetime", "queue_credentials.assume_queue_role_for_user", "mock_boto3_client.assume_queue_role_for_user.assert_called_once_with"] | 0 | [] | The function (test_assume_queue_role_for_user) defined within the public class called public.The function start at line 23 and ends at 48. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_assume_queue_role_for_read | def test_assume_queue_role_for_read(mock_boto3_client):"""Test assuming read role for a queue."""# Setupexpiration = datetime.datetime(2025, 4, 8, 20, 0, 46)mock_boto3_client.assume_queue_role_for_read.return_value = {"Credentials": {"AccessKeyId": "ASIAEXAMPLE","SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLE... | 1 | 20 | 1 | 120 | 2 | 51 | 76 | 51 | mock_boto3_client | ['result', 'expiration'] | None | {"Assign": 3, "Expr": 2} | 3 | 26 | 3 | ["datetime.datetime", "queue_credentials.assume_queue_role_for_read", "mock_boto3_client.assume_queue_role_for_read.assert_called_once_with"] | 0 | [] | The function (test_assume_queue_role_for_read) defined within the public class called public.The function start at line 51 and ends at 76. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_assume_queue_role_client_error | def test_assume_queue_role_client_error(mock_boto3_client):"""Test error handling when assuming role fails."""# Setupfrom botocore.exceptions import ClientErrormock_boto3_client.assume_queue_role_for_user.side_effect = ClientError({"Error": {"Code": "AccessDenied", "Message": "Access denied"}},"AssumeQueueRoleForUser",... | 1 | 11 | 1 | 68 | 0 | 79 | 95 | 79 | mock_boto3_client | [] | None | {"Assign": 1, "Expr": 2, "With": 1} | 4 | 17 | 4 | ["ClientError", "pytest.raises", "queue_credentials.assume_queue_role_for_user", "str"] | 0 | [] | The function (test_assume_queue_role_client_error) defined within the public class called public.The function start at line 79 and ends at 95. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_debug_logging_on | def test_cli_debug_logging_on(fresh_deadline_config):"""Confirm that --log-level DEBUG turns on debug logging."""# The CliRunner environment already has the logger configured,# so we instead run it as a subprocess to match the actual# environment.output = subprocess.check_output(args=[sys.executable, "-m", "deadline", ... | 1 | 7 | 1 | 47 | 1 | 23 | 36 | 23 | fresh_deadline_config | ['output'] | None | {"Assign": 1, "Expr": 1} | 1 | 14 | 1 | ["subprocess.check_output"] | 0 | [] | The function (test_cli_debug_logging_on) defined within the public class called public.The function start at line 23 and ends at 36. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declare 1.0 function, and It has 1.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_redirect_output | def test_cli_redirect_output(fresh_deadline_config, tmp_path):"""Confirm that --redirect-output FILENAME sends stdout/stderr to a file."""# The CliRunner environment already has the logger configured,# so we instead run it as a subprocess to match the actual# environment.out_file = tmp_path / "out.txt"output = subproce... | 1 | 20 | 2 | 88 | 3 | 39 | 68 | 39 | fresh_deadline_config,tmp_path | ['output', 'file_output', 'out_file'] | None | {"Assign": 3, "Expr": 1, "With": 1} | 5 | 30 | 5 | ["subprocess.check_output", "str", "open", "fh.read", "file_output.startswith"] | 0 | [] | The function (test_cli_redirect_output) defined within the public class called public.The function start at line 39 and ends at 68. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [39.0] and does not return any value. It declares 5.0 functions, and It has 5.0... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_redirect_output_with_mode | def test_cli_redirect_output_with_mode(fresh_deadline_config, tmp_path, redirect_mode):"""Confirm that --redirect-output FILENAME sends stdout/stderr to a file,and --redirect-mode controls appending vs replacing."""out_file = tmp_path / "out.txt"with open(out_file, "w", encoding="utf-8") as fh:fh.write("Initial content... | 2 | 27 | 3 | 134 | 3 | 72 | 113 | 72 | fresh_deadline_config,tmp_path,redirect_mode | ['output', 'file_output', 'out_file'] | None | {"Assign": 3, "Expr": 2, "If": 1, "With": 2} | 9 | 42 | 9 | ["open", "fh.write", "subprocess.check_output", "str", "open", "fh.read", "file_output.startswith", "file_output.startswith", "pytest.mark.parametrize"] | 0 | [] | The function (test_cli_redirect_output_with_mode) defined within the public class called public.The function start at line 72 and ends at 113. It contains 27 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [72.0] and does not return any value. It declares 9.0 functions, and ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_unfamiliar_exception | def test_cli_unfamiliar_exception(fresh_deadline_config):"""Test that unfamiliar exceptions get the extra context"""# Change the `login` function so it just raises an exceptionwith patch.object(api._session, "get_boto3_session"), patch.object(api, "login") as login_mock:login_mock.side_effect = Exception("An unexpected... | 1 | 8 | 1 | 74 | 2 | 116 | 129 | 116 | fresh_deadline_config | ['runner', 'result'] | None | {"Assign": 3, "Expr": 1, "With": 1} | 5 | 14 | 5 | ["patch.object", "patch.object", "Exception", "CliRunner", "runner.invoke"] | 0 | [] | The function (test_cli_unfamiliar_exception) defined within the public class called public.The function start at line 116 and ends at 129. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 5.0 functions, and It has ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_group_without_command | def test_cli_group_without_command(fresh_deadline_config, cli_group):"""Test that each group prints the usage screen if no command is provided"""runner = CliRunner()result = runner.invoke(main, [cli_group])assert result.output.startswith("Usage:") | 1 | 4 | 2 | 34 | 2 | 133 | 140 | 133 | fresh_deadline_config,cli_group | ['runner', 'result'] | None | {"Assign": 2, "Expr": 1} | 4 | 8 | 4 | ["CliRunner", "runner.invoke", "result.output.startswith", "pytest.mark.parametrize"] | 0 | [] | The function (test_cli_group_without_command) defined within the public class called public.The function start at line 133 and ends at 140. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [133.0] and does not return any value. It declares 4.0 functions, and It... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_object_repr | def test_cli_object_repr(obj, expected):"""Test that the CLI object represntation is expected."""assert _cli_object_repr(obj) == expected | 1 | 2 | 2 | 15 | 0 | 164 | 168 | 164 | obj,expected | [] | None | {"Expr": 1} | 8 | 5 | 8 | ["_cli_object_repr", "pytest.mark.parametrize", "pytest.param", "pytest.param", "pytest.param", "pytest.param", "pytest.param", "pytest.param"] | 0 | [] | The function (test_cli_object_repr) defined within the public class called public.The function start at line 164 and ends at 168. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [164.0] and does not return any value. It declares 8.0 functions, and It has 8.0 f... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_all_cli_commands_use_context_tracking_command._get_all_click_commands | def _get_all_click_commands(cmd: click.Command,found_cmds: List[click.Command],) -> List[click.Command]:"""Gets all leaf commands under a given command"""if isinstance(cmd, click.Group):for subcmd in cmd.commands.values():_get_all_click_commands(subcmd, found_cmds)else:found_cmds.append(cmd)return found_cmds | 3 | 10 | 2 | 64 | 0 | 176 | 186 | 176 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_all_cli_commands_use_context_tracking_command._get_all_click_commands) defined within the public class called public.The function start at line 176 and ends at 186. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [176.0] and does not return ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_all_cli_commands_use_context_tracking_command | def test_all_cli_commands_use_context_tracking_command():"""Retrieves all click commands and verifies they all use the ContextTrackingCommand subclass"""def _get_all_click_commands(cmd: click.Command,found_cmds: List[click.Command],) -> List[click.Command]:"""Gets all leaf commands under a given command"""if isinstance... | 2 | 4 | 0 | 36 | 1 | 171 | 189 | 171 | ['all_commands'] | Returns | {"Assign": 1, "Expr": 4, "For": 1, "If": 1, "Return": 1} | 7 | 19 | 7 | ["isinstance", "cmd.commands.values", "_get_all_click_commands", "found_cmds.append", "_get_all_click_commands", "all", "isinstance"] | 0 | [] | The function (test_all_cli_commands_use_context_tracking_command) defined within the public class called public.The function start at line 171 and ends at 189. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters, and this function return a value. It declares 7.... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_context_tracking_command_sets_boto_user_agent_extra.test_main | def test_main():pass | 1 | 2 | 0 | 5 | 0 | 198 | 199 | 198 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_context_tracking_command_sets_boto_user_agent_extra.test_main) defined within the public class called public.The function start at line 198 and ends at 199. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_context_tracking_command_sets_boto_user_agent_extra.test_subcmd | def test_subcmd():pass | 1 | 2 | 0 | 5 | 0 | 202 | 203 | 202 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_context_tracking_command_sets_boto_user_agent_extra.test_subcmd) defined within the public class called public.The function start at line 202 and ends at 203. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.. |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_context_tracking_command_sets_boto_user_agent_extra.test_command | def test_command():pass | 1 | 2 | 0 | 5 | 0 | 206 | 207 | 206 | null | [] | None | null | 0 | 0 | 0 | null | 0 | null | The function (test_context_tracking_command_sets_boto_user_agent_extra.test_command) defined within the public class called public.The function start at line 206 and ends at 207. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value.... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_context_tracking_command_sets_boto_user_agent_extra | def test_context_tracking_command_sets_boto_user_agent_extra():"""Verifies that the ContextTrackingCommand sets the user_agent_extra in boto clients"""@click.group(cls=ContextTrackingGroup, name="main")def test_main():pass@test_main.group(name="subcommand")def test_subcmd():pass@test_subcmd.command(name="command")def t... | 1 | 10 | 0 | 69 | 1 | 192 | 213 | 192 | ['config'] | None | {"Assign": 1, "Expr": 2} | 6 | 22 | 6 | ["click.group", "test_main.group", "test_subcmd.command", "invoke", "CliRunner", "get_default_client_config"] | 0 | [] | The function (test_context_tracking_command_sets_boto_user_agent_extra) defined within the public class called public.The function start at line 192 and ends at 213. It contains 10 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares... | |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_attachment_existence | def test_cli_attachment_existence(fresh_deadline_config):"""Confirm that the subcommand group is availble for environment with no JOB_ATTACHMENT_CLI"""assert not os.environ.get("JOB_ATTACHMENT_CLI")runner = CliRunner()response = runner.invoke(main, ["attachment"])assert "Usage: main attachment" in response.output | 1 | 5 | 1 | 39 | 2 | 14 | 24 | 14 | fresh_deadline_config | ['runner', 'response'] | None | {"Assign": 2, "Expr": 1} | 3 | 11 | 3 | ["os.environ.get", "CliRunner", "runner.invoke"] | 0 | [] | The function (test_cli_attachment_existence) defined within the public class called public.The function start at line 14 and ends at 24. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 3.0 functions, and It has 3.... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_deadline_cloud_monitor_login_and_logout | def test_cli_deadline_cloud_monitor_login_and_logout(fresh_deadline_config):"""Confirm that the CLI login/logout command invokes Deadline Cloud monitor as expected"""scoped_config = {"credential_process": "/bin/DeadlineCloudMonitor get-credentials --profile sandbox-us-west-2","monitor_id": "monitor-1g9neezauta8ease","r... | 2 | 53 | 1 | 341 | 4 | 20 | 88 | 20 | fresh_deadline_config | ['result', 'runner', 'profile_name', 'scoped_config'] | None | {"Assign": 10, "Expr": 8, "If": 1, "With": 1} | 22 | 69 | 22 | ["config.set_setting", "config.set_setting", "patch.object", "patch.object", "patch.object", "patch.object", "patch.object", "patch.object", "session_mock", "session_mock", "session_mock", "bytes", "CliRunner", "runner.invoke", "sys.platform.startswith", "popen_mock.assert_called_once_with", "popen_mock.assert_called_o... | 0 | [] | The function (test_cli_deadline_cloud_monitor_login_and_logout) defined within the public class called public.The function start at line 20 and ends at 88. It contains 53 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value. It declares 22.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_auth_status | def test_cli_auth_status(fresh_deadline_config):"""Confirm that the CLI status command prints out as expected"""# GIVENprofile_name = "sandbox-us-west-2"config.set_setting("defaults.aws_profile_name", profile_name)with patch.object(api._session, "get_boto3_session") as session_mock, patch.object(api, "get_boto3_session... | 1 | 14 | 1 | 100 | 3 | 91 | 114 | 91 | fresh_deadline_config | ['result', 'runner', 'profile_name'] | None | {"Assign": 4, "Expr": 2, "With": 1} | 6 | 24 | 6 | ["config.set_setting", "patch.object", "patch.object", "session_mock", "CliRunner", "runner.invoke"] | 0 | [] | The function (test_cli_auth_status) defined within the public class called public.The function start at line 91 and ends at 114. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 6.0 functions, and It has 6.0 funct... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_auth_status_json | def test_cli_auth_status_json(fresh_deadline_config):"""Confirm that the CLI status command gives valid json back"""# GIVENprofile_name = "sandbox-us-west-2"expected = {"profile_name": profile_name,"source": "DEADLINE_CLOUD_MONITOR_LOGIN","status": "AUTHENTICATED","api_availability": False,}scoped_config = {"credential... | 1 | 25 | 1 | 158 | 6 | 117 | 152 | 117 | fresh_deadline_config | ['profile_name', 'scoped_config', 'expected', 'runner', 'result', 'actual'] | None | {"Assign": 9, "Expr": 2, "With": 1} | 9 | 36 | 9 | ["config.set_setting", "patch.object", "patch.object", "session_mock", "session_mock", "session_mock", "CliRunner", "runner.invoke", "json.loads"] | 0 | [] | The function (test_cli_auth_status_json) defined within the public class called public.The function start at line 117 and ends at 152. It contains 25 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 9.0 functions, and It has 9.0... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_submit_simple_json_template | def test_cli_bundle_submit_simple_json_template(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Confirm that CLI bundle submit makes the right create_job call from a simple JSON template."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)deadline_m... | 1 | 30 | 3 | 235 | 2 | 36 | 75 | 36 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 6, "With": 2} | 11 | 40 | 11 | ["config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_with"] | 0 | [] | The function (test_cli_bundle_submit_simple_json_template) defined within the public class called public.The function start at line 36 and ends at 75. It contains 30 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [36.0] and does not return any value. It declares 11.0 functi... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_explicit_parameters | def test_cli_bundle_explicit_parameters(fresh_deadline_config, temp_job_bundle_dir):"""Confirm that --profile, --farm-id, and --queue-id get passed in from the CLI.This test mocks the Session object instead of using moto, to confirm calls with anAWS profile that doesn't exist in the config."""# Write a JSON templatewit... | 1 | 33 | 2 | 203 | 2 | 78 | 122 | 78 | fresh_deadline_config,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 4, "With": 2} | 14 | 45 | 14 | ["open", "os.path.join", "f.write", "patch.object", "client", "session_mock", "client", "session_mock", "CliRunner", "runner.invoke", "session_mock.assert_called_with", "create_job.assert_called_once_with", "client", "session_mock"] | 0 | [] | The function (test_cli_bundle_explicit_parameters) defined within the public class called public.The function start at line 78 and ends at 122. It contains 33 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [78.0] and does not return any value. It declares 14.0 functions, an... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_priority_retries | def test_cli_bundle_priority_retries(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Confirm that --priority, --max-failed-tasks-count, --max_worker_count and --max-retries-per-task get passed in from the CLI."""# Write a JSON templatewith open(os.path.join(temp_job_bundle_dir, "template.json"), "w", enco... | 1 | 40 | 3 | 175 | 2 | 125 | 171 | 125 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 3, "With": 1} | 6 | 47 | 6 | ["open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_once_with"] | 0 | [] | The function (test_cli_bundle_priority_retries) defined within the public class called public.The function start at line 125 and ends at 171. It contains 40 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [125.0] and does not return any value. It declares 6.0 functions, and ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_job_name | def test_cli_bundle_job_name(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Confirm that --name sets the job name in the template."""# Write a JSON templatewith open(os.path.join(temp_job_bundle_dir, "template.json"), "w", encoding="utf8") as f:f.write(MOCK_JOB_TEMPLATE_CASES["MINIMAL_JSON"][1])deadline_... | 1 | 31 | 3 | 154 | 2 | 174 | 211 | 174 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 3, "With": 1} | 7 | 38 | 7 | ["open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_once_with", "get_minimal_json_job_template"] | 0 | [] | The function (test_cli_bundle_job_name) defined within the public class called public.The function start at line 174 and ends at 211. It contains 31 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [174.0] and does not return any value. It declares 7.0 functions, and It has ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_storage_profile_id | def test_cli_bundle_storage_profile_id(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Confirm that --storage-profile-id sets the ID that the job is submitted with, but does notchange the value of storage profile saved to the configuration file."""PRE_STORAGE_PROFILE_ID = "sp-11223344556677889900abbccddee... | 1 | 36 | 3 | 212 | 4 | 214 | 262 | 214 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result', 'PRE_STORAGE_PROFILE_ID', 'CLI_STORAGE_PROFILE_ID'] | None | {"Assign": 6, "Expr": 6, "With": 3} | 12 | 49 | 12 | ["config.set_setting", "config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "CliRunner", "patch.object", "runner.invoke", "deadline_mock.create_job.assert_called_once_with", "patch.object", "config.get_setting"] | 0 | [] | The function (test_cli_bundle_storage_profile_id) defined within the public class called public.The function start at line 214 and ends at 262. It contains 36 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [214.0] and does not return any value. It declares 12.0 functions, a... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_asset_load_method | def test_cli_bundle_asset_load_method(fresh_deadline_config, deadline_mock, temp_job_bundle_dir, loading_method):"""Verify that asset loading method set on CLI are passed to the CreateJob call.The job attachments S3 bucket is a moto mock, so the verified calls exercise the relevant code for that."""config.set_setting("... | 4 | 65 | 4 | 379 | 5 | 266 | 348 | 266 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir,loading_method | ['expected_loading_method', 'runner', 'params', 'result', 'data'] | None | {"Assign": 7, "AugAssign": 1, "Expr": 8, "If": 1, "With": 3} | 17 | 83 | 17 | ["config.set_setting", "config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "open", "os.path.join", "f.write", "open", "os.path.join", "json.dump", "CliRunner", "runner.invoke", "config.get_setting", "deadline_mock.create_job.assert_called_once_with", "pytest.mark.parametrize"] | 0 | [] | The function (test_cli_bundle_asset_load_method) defined within the public class called public.The function start at line 266 and ends at 348. It contains 65 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [266.0] and does not return any value. It declares 17.0 functions, an... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_job_parameter_from_cli | def test_cli_bundle_job_parameter_from_cli(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Verify that job parameters specified at the CLI are passed to the CreateJob call"""# Write a JSON templatewith open(os.path.join(temp_job_bundle_dir, "template.json"), "w", encoding="utf8") as f:f.write(MOCK_JOB_TEM... | 1 | 45 | 3 | 191 | 2 | 351 | 404 | 351 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 4, "With": 1} | 7 | 54 | 7 | ["open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_once_with", "deadline_mock.get_deadline_cloud_library_telemetry_client.return_value.record_event.assert_any_call"] | 0 | [] | The function (test_cli_bundle_job_parameter_from_cli) defined within the public class called public.The function start at line 351 and ends at 404. It contains 45 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [351.0] and does not return any value. It declares 7.0 functions... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_empty_job_parameter_from_cli | def test_cli_bundle_empty_job_parameter_from_cli(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Verify that an empty job parameter specified at the CLI are passed to the CreateJob call"""# Write a JSON templatewith open(os.path.join(temp_job_bundle_dir, "template.json"), "w", encoding="utf8") as f:f.writ... | 1 | 35 | 3 | 153 | 2 | 407 | 449 | 407 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 2, "With": 1} | 6 | 43 | 6 | ["open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "call"] | 0 | [] | The function (test_cli_bundle_empty_job_parameter_from_cli) defined within the public class called public.The function start at line 407 and ends at 449. It contains 35 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [407.0] and does not return any value. It declares 6.0 fun... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_job_parameter_with_equals_from_cli | def test_cli_bundle_job_parameter_with_equals_from_cli(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Verify that a job parameter value with an '=' in it is passed correctly to the CreateJob call"""# Write a JSON templatewith open(os.path.join(temp_job_bundle_dir, "template.json"), "w", encoding="utf8") ... | 1 | 33 | 3 | 144 | 2 | 452 | 492 | 452 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 3, "With": 1} | 6 | 41 | 6 | ["open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_once_with"] | 0 | [] | The function (test_cli_bundle_job_parameter_with_equals_from_cli) defined within the public class called public.The function start at line 452 and ends at 492. It contains 33 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [452.0] and does not return any value. It declares 6... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_invalid_job_parameter | def test_cli_bundle_invalid_job_parameter(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Verify that a badly formatted parameter value (without "Key=Value") throws an error"""# Write a JSON templatewith open(os.path.join(temp_job_bundle_dir, "template.json"), "w", encoding="utf8") as f:f.write(MOCK_JOB_T... | 1 | 24 | 3 | 106 | 2 | 495 | 525 | 495 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 2, "With": 1} | 5 | 31 | 5 | ["open", "os.path.join", "f.write", "CliRunner", "runner.invoke"] | 0 | [] | The function (test_cli_bundle_invalid_job_parameter) defined within the public class called public.The function start at line 495 and ends at 525. It contains 24 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [495.0] and does not return any value. It declares 5.0 functions,... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_invalid_job_parameter_name | def test_cli_bundle_invalid_job_parameter_name(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Verify that a non-identifier parameter name raises an error."""# Write a JSON templatewith open(os.path.join(temp_job_bundle_dir, "template.json"), "w", encoding="utf8") as f:f.write(MOCK_JOB_TEMPLATE_CASES["MIN... | 1 | 24 | 3 | 106 | 2 | 528 | 558 | 528 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 4, "Expr": 2, "With": 1} | 5 | 31 | 5 | ["open", "os.path.join", "f.write", "CliRunner", "runner.invoke"] | 0 | [] | The function (test_cli_bundle_invalid_job_parameter_name) defined within the public class called public.The function start at line 528 and ends at 558. It contains 24 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [528.0] and does not return any value. It declares 5.0 funct... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_accept_upload_confirmation | def test_cli_bundle_accept_upload_confirmation(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Verify that when the user accepts the job attachments upload confirmationthat CreateJob is called properly still."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOC... | 1 | 46 | 3 | 230 | 3 | 561 | 617 | 561 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result', 'data'] | None | {"Assign": 5, "Expr": 7, "With": 2} | 12 | 57 | 12 | ["config.set_setting", "config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "open", "os.path.join", "json.dump", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_with"] | 0 | [] | The function (test_cli_bundle_accept_upload_confirmation) defined within the public class called public.The function start at line 561 and ends at 617. It contains 46 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [561.0] and does not return any value. It declares 12.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_reject_upload_confirmation | def test_cli_bundle_reject_upload_confirmation(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Verify that when the user rejects the job attachments upload confirmationthat no further action is taken after that point, and that a failure CLI exit code results."""config.set_setting("defaults.farm_id", MOCK_... | 1 | 40 | 3 | 206 | 3 | 620 | 670 | 620 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result', 'data'] | None | {"Assign": 5, "Expr": 7, "With": 3} | 13 | 51 | 13 | ["config.set_setting", "config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "open", "os.path.join", "json.dump", "patch.object", "CliRunner", "runner.invoke", "mock_upload_assets.assert_not_called"] | 0 | [] | The function (test_cli_bundle_reject_upload_confirmation) defined within the public class called public.The function start at line 620 and ends at 670. It contains 40 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [620.0] and does not return any value. It declares 13.0 func... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_gui_submit_submitter_name | def test_gui_submit_submitter_name(_mock_context):"""Verify that the --submitter-name arg gets passed through correctly"""# Unconventional mocking pattern because of how the function is imported in codemock_job_bundle_submitter = Mock()sys.modules["deadline.client.ui.job_bundle_submitter"] = mock_job_bundle_submittermo... | 1 | 11 | 1 | 62 | 2 | 674 | 690 | 674 | _mock_context | ['runner', 'mock_job_bundle_submitter'] | None | {"Assign": 4, "Expr": 3} | 4 | 17 | 4 | ["Mock", "CliRunner", "runner.invoke", "patch"] | 0 | [] | The function (test_gui_submit_submitter_name) defined within the public class called public.The function start at line 674 and ends at 690. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value. It declares 4.0 functions, and It ha... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_bundle_submit_with_target_task_run_status | def test_bundle_submit_with_target_task_run_status(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Test that the --target-task-run-status CLI option is passed through correctly."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)# Write a JSON templ... | 1 | 24 | 3 | 131 | 2 | 693 | 724 | 693 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 5, "Expr": 5, "With": 1} | 8 | 32 | 8 | ["config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_once"] | 0 | [] | The function (test_bundle_submit_with_target_task_run_status) defined within the public class called public.The function start at line 693 and ends at 724. It contains 24 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [693.0] and does not return any value. It declares 8.0 f... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_bundle_submit_without_target_task_run_status | def test_bundle_submit_without_target_task_run_status(fresh_deadline_config, deadline_mock, temp_job_bundle_dir):"""Test that when --target-task-run-status is not specified, None is passed."""config.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)# Write a JSON templat... | 1 | 22 | 3 | 125 | 2 | 727 | 756 | 727 | fresh_deadline_config,deadline_mock,temp_job_bundle_dir | ['runner', 'result'] | None | {"Assign": 5, "Expr": 5, "With": 1} | 8 | 30 | 8 | ["config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "CliRunner", "runner.invoke", "deadline_mock.create_job.assert_called_once"] | 0 | [] | The function (test_bundle_submit_without_target_task_run_status) defined within the public class called public.The function start at line 727 and ends at 756. It contains 22 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [727.0] and does not return any value. It declares 8.... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | normalize_job_bundle_timestamps | def normalize_job_bundle_timestamps(job_bundle_dir):"""Sets the timestamps of all the files in a job bundle directory to one fixed value."""for root, _, files in os.walk(job_bundle_dir):for filename in files:full_filename = os.path.join(root, filename)os.utime(full_filename, (1756710000, 1756710000)) | 3 | 5 | 1 | 49 | 1 | 30 | 35 | 30 | job_bundle_dir | ['full_filename'] | None | {"Assign": 1, "Expr": 2, "For": 2} | 3 | 6 | 3 | ["os.walk", "os.path.join", "os.utime"] | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_bundle_submit_debug_snapshot_py.test_cli_bundle_submit_debug_snapshot"] | The function (normalize_job_bundle_timestamps) defined within the public class called public.The function start at line 30 and ends at 35. It contains 5 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value. It declares 3.0 functions, It has 3.0 f... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | normalize_snapshot | def normalize_snapshot(snapshot_dir):"""Normalizes the platform-specific directories into named tokens, and '\\' on Windows to '/'"""# Normalize to LF line endings, and then on Windows back to CRLF for consistent comparison with git checkout of snapshotreplacements: list[tuple[str, str]] = []if os.name != "nt":replacem... | 8 | 44 | 1 | 353 | 8 | 38 | 94 | 38 | snapshot_dir | ['manifest_path', 'manifest_new_name', 'root_path', 'full_filename', 'create_job_args', 'manifest_old_name', 'manifest_name', 'contents'] | None | {"AnnAssign": 1, "Assign": 9, "Expr": 10, "For": 3, "If": 4, "With": 3} | 29 | 57 | 29 | ["replacements.append", "open", "_get_long_path_compatible_path", "json.load", "enumerate", "replacements.append", "replacements.append", "root_path.replace", "replacements.append", "replacements.append", "root_path.replace", "manifest_path.rsplit", "replacements.append", "replacements.append", "_get_long_path_compatib... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_bundle_submit_debug_snapshot_py.test_cli_bundle_submit_debug_snapshot"] | The function (normalize_snapshot) defined within the public class called public.The function start at line 38 and ends at 94. It contains 44 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value. It declares 29.0 functions, It has 29.0 functions c... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | assert_directories_equal | def assert_directories_equal(snapshot_dir, expected_dir):# Walk through the two directories together and comparesnap_extra: list[str] = []exp_extra: list[str] = []files_differ: list[tuple[str, str]] = []for (snap_root, snap_dirs, snap_files), (exp_root, exp_dirs, exp_files) in zip(os.walk(snapshot_dir), os.walk(expecte... | 11 | 38 | 2 | 420 | 2 | 97 | 141 | 97 | snapshot_dir,expected_dir | ['contents2', 'contents1'] | None | {"AnnAssign": 3, "Assign": 3, "Expr": 7, "For": 4, "If": 2, "With": 3} | 41 | 45 | 41 | ["zip", "os.walk", "os.walk", "snap_extra.extend", "os.path.join", "set", "set", "exp_extra.extend", "os.path.join", "set", "set", "intersection", "set", "snap_extra.extend", "os.path.join", "set", "set", "exp_extra.extend", "os.path.join", "set", "set", "intersection", "set", "open", "_get_long_path_compatible_path", ... | 1 | ["_.content.gdrive.MyDrive.Phd_Thesis.Dataset_Creation.Output.Cloned_Repo_3.94876780_aws_deadline_deadline_cloud.test.unit.deadline_client.cli.test_cli_bundle_submit_debug_snapshot_py.test_cli_bundle_submit_debug_snapshot"] | The function (assert_directories_equal) defined within the public class called public.The function start at line 97 and ends at 141. It contains 38 lines of code and it has a cyclomatic complexity of 11. It takes 2 parameters, represented as [97.0] and does not return any value. It declares 41.0 functions, It has 41.0 ... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_submit_debug_snapshot | def test_cli_bundle_submit_debug_snapshot(fresh_deadline_config, deadline_mock, tmp_path):"""Confirm that CLI bundle submit makes the right create_job call from a simple JSON template."""# Make sure the temporary path has no symlinkstmp_path = tmp_path.resolve()config.set_setting("defaults.farm_id", MOCK_FARM_ID)config... | 2 | 36 | 3 | 192 | 6 | 144 | 191 | 144 | fresh_deadline_config,deadline_mock,tmp_path | ['job_bundle_dir', 'tmp_path', 'expected_snapshot_dir', 'regenerate_snapshot', 'runner', 'result'] | None | {"Assign": 9, "Expr": 8, "If": 1, "With": 1} | 17 | 48 | 17 | ["tmp_path.resolve", "config.set_setting", "config.set_setting", "Path", "job_bundle_dir.resolve", "Path", "expected_snapshot_dir.resolve", "normalize_job_bundle_timestamps", "shutil.rmtree", "patch.object", "CliRunner", "runner.invoke", "str", "str", "deadline_mock.create_job.assert_not_called", "normalize_snapshot", ... | 0 | [] | The function (test_cli_bundle_submit_debug_snapshot) defined within the public class called public.The function start at line 144 and ends at 191. It contains 36 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [144.0] and does not return any value. It declares 17.0 functions... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_filter_redundant_known_paths | def test_filter_redundant_known_paths(input, expected):assert sorted(_filter_redundant_known_paths(input)) == expectedif os.name == "nt":assert sorted(_filter_redundant_known_paths(path.replace("/", "\\") for path in input)) == [path.replace("/", "\\") for path in expected]assert sorted(_filter_redundant_known_paths("C... | 6 | 9 | 2 | 96 | 0 | 40 | 48 | 40 | input,expected | [] | None | {"If": 1} | 11 | 9 | 11 | ["sorted", "_filter_redundant_known_paths", "sorted", "_filter_redundant_known_paths", "path.replace", "path.replace", "sorted", "_filter_redundant_known_paths", "path.replace", "path.replace", "pytest.mark.parametrize"] | 0 | [] | The function (test_filter_redundant_known_paths) defined within the public class called public.The function start at line 40 and ends at 48. It contains 9 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [40.0] and does not return any value. It declares 11.0 functions, and I... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_known_paths_combine | def test_cli_bundle_known_paths_combine(fresh_deadline_config, temp_job_bundle_dir):"""Test that the CLI combines known upload paths from both the CLI parameterand the configuration setting."""# Set up configurationconfig.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID... | 5 | 62 | 2 | 389 | 8 | 51 | 136 | 51 | fresh_deadline_config,temp_job_bundle_dir | ['config_path1', 'cli_path1', 'runner', 'known_paths', 'result', 'config_path2', 'cli_path2', 'external_file_path'] | None | {"Assign": 10, "Expr": 11, "Try": 1, "With": 4} | 20 | 86 | 20 | ["config.set_setting", "config.set_setting", "config.set_setting", "config.set_setting", "os.pathsep.join", "open", "os.path.join", "f.write", "tempfile.NamedTemporaryFile", "temp_file.write", "open", "os.path.join", "json.dump", "patch_calls_for_create_job_from_job_bundle", "os.path.dirname", "CliRunner", "runner.invo... | 0 | [] | The function (test_cli_bundle_known_paths_combine) defined within the public class called public.The function start at line 51 and ends at 136. It contains 62 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [51.0] and does not return any value. It declares 20.0 functions, an... |
aws-deadline_deadline-cloud | public | public | 0 | 0 | test_cli_bundle_storage_profile_known_paths | def test_cli_bundle_storage_profile_known_paths(fresh_deadline_config, temp_job_bundle_dir):"""Test that known paths from a storage profile are included when submitting a job bundle."""# Set up configurationconfig.set_setting("defaults.farm_id", MOCK_FARM_ID)config.set_setting("defaults.queue_id", MOCK_QUEUE_ID)config.... | 4 | 83 | 2 | 428 | 9 | 139 | 252 | 139 | fresh_deadline_config,temp_job_bundle_dir | ['local_storage_profile_path', 'storage_profile_response', 'storage_profile_id', 'os_family', 'shared_storage_profile_path', 'runner', 'known_paths', 'result', 'external_file_path'] | None | {"Assign": 12, "Expr": 11, "Try": 1, "With": 4} | 22 | 114 | 22 | ["config.set_setting", "config.set_setting", "config.set_setting", "config.set_setting", "open", "os.path.join", "f.write", "tempfile.NamedTemporaryFile", "temp_file.write", "open", "os.path.join", "json.dump", "os.path.dirname", "patch_calls_for_create_job_from_job_bundle", "mock.get_boto3_client", "CliRunner", "runne... | 0 | [] | The function (test_cli_bundle_storage_profile_known_paths) defined within the public class called public.The function start at line 139 and ends at 252. It contains 83 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [139.0] and does not return any value. It declares 22.0 fun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.