(self)
| 198 | self._ssl_error = ssl_error |
| 199 | |
| 200 | def create_table_html(self): |
| 201 | scr_path = os.path.relpath(self.screenshot_path, self.root_path) |
| 202 | src_path = os.path.relpath(self.source_path, self.root_path) |
| 203 | html = u"" |
| 204 | if self._remote_login is not None: |
| 205 | html += ("""<tr> |
| 206 | <td><div style=\"display: inline-block; width: 300px; word-wrap: break-word\"> |
| 207 | <a href=\"{address}\" target=\"_blank\">{address}</a><br> |
| 208 | """).format(address=self._remote_login) |
| 209 | else: |
| 210 | html += ("""<tr> |
| 211 | <td><div style=\"display: inline-block; width: 300px; word-wrap: break-word\"> |
| 212 | <a href=\"{address}\" target=\"_blank\">{address}</a><br> |
| 213 | """).format(address=self.remote_system) |
| 214 | |
| 215 | if self.resolved != None and self.resolved != 'Unknown': |
| 216 | html += ("""<b>Resolved to:</b> {0}<br>""").format(self.resolved) |
| 217 | |
| 218 | if len(self._uadata) > 0: |
| 219 | html += (""" |
| 220 | <br><b>This is the baseline request.</b><br> |
| 221 | The browser type is: <b>Baseline</b><br><br> |
| 222 | The user agent is: <b>Baseline</b><br><br>""") |
| 223 | |
| 224 | if self.ssl_error: |
| 225 | html += "<br><b>SSL Certificate error present on\ |
| 226 | <a href=\"{0}\" target=\"_blank\">{0}</a></b><br>".format( |
| 227 | self.remote_system) |
| 228 | |
| 229 | if self.default_creds is not None: |
| 230 | try: |
| 231 | html += "<br><b>Default credentials:</b> {0}<br>".format( |
| 232 | self.sanitize(self.default_creds)) |
| 233 | except UnicodeEncodeError: |
| 234 | html += u"<br><b>Default credentials:</b> {0}<br>".format( |
| 235 | self.sanitize(self.default_creds)) |
| 236 | |
| 237 | if self.error_state is None: |
| 238 | try: |
| 239 | html += "\n<br><b> Page Title: </b>{0}\n".format( |
| 240 | self.sanitize(self.page_title)) |
| 241 | except AttributeError: |
| 242 | html += "\n<br><b> Page Title:</b>{0}\n".format( |
| 243 | 'Unable to Display') |
| 244 | except UnicodeDecodeError: |
| 245 | html += "\n<br><b> Page Title:</b>{0}\n".format( |
| 246 | 'Unable to Display') |
| 247 | except UnicodeEncodeError: |
| 248 | html += u"\n<br><b> Page Title:</b>{0}\n".format( |
| 249 | self.sanitize(self.page_title)) |
| 250 | |
| 251 | for key, value in self.headers.items(): |
| 252 | try: |
| 253 | html += '<br><b> {0}:</b> {1}\n'.format( |
| 254 | self.sanitize(key), self.sanitize(value)) |
| 255 | except UnicodeEncodeError: |
| 256 | html += u'<br><b> {0}:</b> {1}\n'.format( |
| 257 | self.sanitize(key), self.sanitize(value)) |
nothing calls this directly
no test coverage detected