()
| 54 | |
| 55 | |
| 56 | def 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 | ... |
| 65 | Plan: 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 | |
| 91 | def test_bad_description(): |
nothing calls this directly
no test coverage detected