MCPcopy Create free account
hub / github.com/dflook/terraform-github-actions / test_headers

Function test_headers

tests/github_pr_comment/test_comment.py:56–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54
55
56def test_headers():
57 issue_url = ''.join(random.choice(string.ascii_letters) for _ in range(10))
58 comment_url = ''.join(random.choice(string.ascii_letters) for _ in range(10))
59 node_id = cast(NodeId, ''.join(random.choice(string.ascii_letters) for _ in range(10)))
60 status = 'Testing'
61 description = 'Hello, this is a description'
62 summary = 'Some changes'
63 body = '''An execution plan has been generated and is shown below.
64...
65Plan: 1 to add, 0 to change, 0 to destroy.
66'''
67 headers = {
68 'hello': 'first_header_value',
69 'there': 'second_header_value'
70 }
71
72 expected = TerraformComment(
73 issue_url=issue_url,
74 comment_url=comment_url,
75 node_id=node_id,
76 status=status,
77 headers=headers,
78 description=description,
79 summary=summary,
80 body=body
81 )
82
83 assert _from_api_payload({
84 'body': _to_api_payload(expected),
85 'url': comment_url,
86 'node_id': node_id,
87 'issue_url': issue_url
88 }) == expected
89
90
91def test_bad_description():

Callers

nothing calls this directly

Calls 3

TerraformCommentClass · 0.90
_from_api_payloadFunction · 0.90
_to_api_payloadFunction · 0.90

Tested by

no test coverage detected