Skip to content

Commit

Permalink
fix(terraform): pr for upgrade-checkov (#5400)
Browse files Browse the repository at this point in the history
.
  • Loading branch information
lirshindalman committed Aug 1, 2023
1 parent 3d91a9c commit 2ed5864
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/terraform/runner/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,6 @@ def test_entity_context_fetching_with_TFDefinitionKey(self):
runner.context = {full_file_path: {'resource': {'aws_lb_listener': {'https1': {'start_line': 1, 'end_line': 7, 'code_lines': [[1, 'resource "aws_lb_listener" "https1" {\n'], [2, ' load_balancer_arn = ""\n'], [3, ' protocol = "HTTPS"\n'], [4, ' default_action {\n'], [5, ' type = ""\n'], [6, ' }\n'], [7, '}']], 'skipped_checks': []}}}}}
entity_with_found_path = {'block_name_': 'aws_lb_listener.https1', 'block_type_': 'resource', 'file_path_': '/tmp/checkov/1069803756901857280/prisma-new-user/TestAutomationRepo_7-30-2023-1-38-24-PM/pr/4/58a43cb0e5daee00398b6c892c9287438c7c74ea/diff/src/file1.tf', 'config_': {'aws_lb_listener': {'https1': {'__end_line__': 7, '__start_line__': 1, 'default_action': [{'type': ['']}], 'load_balancer_arn': [''], 'protocol': ['HTTPS'], '__address__': 'aws_lb_listener.https1'}}}, 'attributes_': {'__end_line__': 7, '__start_line__': 1, 'default_action': {'type': ''}, 'load_balancer_arn': [''], 'protocol': ['HTTPS'], 'resource_type': ['aws_lb_listener'], 'default_action.type': '', '__address__': 'aws_lb_listener.https1'}, 'label_': 'resource: aws_lb_listener.https1', 'id_': 'aws_lb_listener.https1', 'customer_name_': '1069803756901857280', 'account_id_': 'prisma-new-user/TestAutomationRepo_7-30-2023-1-38-24-PM/CICD/243676', 'unique_tag_': 'prod', 'source_': 'terraform', 'violations_count_': 0, 'region_': '', '__end_line__': 7, '__start_line__': 1, 'default_action': {'type': ''}, 'default_action.type': '', 'load_balancer_arn': '', 'protocol': 'HTTPS', 'resource_type': 'aws_lb_listener', '__address__': 'aws_lb_listener.https1', 'module_dependency_': '', 'module_dependency_num_': '', 'hash': 'd61bc3a35537776896f83679a51e63d3a6074f66b368bc4fea07871d282875e9'}
entity_context = runner.get_entity_context_and_evaluations(entity_with_found_path)

assert entity_context is not None
assert entity_context['start_line'] == 1 and entity_context['end_line'] == 7

Expand Down

0 comments on commit 2ed5864

Please sign in to comment.