(filename)
| 142 | |
| 143 | |
| 144 | def 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 | |
| 161 | def verify_has_only_ascii_chars(filename): |
no test coverage detected