MCPcopy Create free account
hub / github.com/aws/aws-cli / verify_no_http_links

Function verify_no_http_links

tests/functional/docs/test_examples.py:144–158  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

142
143
144def verify_no_http_links(filename):
145 with open(filename) as f:
146 contents = f.read()
147 match = HTTP_LINK_REGEX.search(contents)
148 if match:
149 error_line_number = line_num(contents, match.span()[0])
150 error_line = extract_error_line(
151 contents, match.span()[0], match.span()[1]
152 )
153 marker_idx = error_line.find('http://') - 1
154 marker_line = (" " * marker_idx) + '^'
155 raise AssertionError(
156 'Found http:// link in the examples file %s, line %s\n'
157 '%s\n%s' % (filename, error_line_number, error_line, marker_line)
158 )
159
160
161def verify_has_only_ascii_chars(filename):

Callers 1

test_rst_doc_examplesFunction · 0.85

Calls 4

line_numFunction · 0.85
extract_error_lineFunction · 0.85
searchMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected