(self)
| 192 | self.check_errors() |
| 193 | |
| 194 | def check_errors(self): |
| 195 | self.log_info(_("Checking for link errors...")) |
| 196 | |
| 197 | if not self.data: |
| 198 | self.log_warning(_("No data to check")) |
| 199 | return |
| 200 | |
| 201 | m = search_pattern(self.LOGIN_BAN_PATTERN, self.data) |
| 202 | if m is not None: |
| 203 | try: |
| 204 | errmsg = m.group(1) |
| 205 | |
| 206 | except (AttributeError, IndexError): |
| 207 | errmsg = m.group(0) |
| 208 | |
| 209 | finally: |
| 210 | errmsg = re.sub(r'<.*?>', " ", errmsg.strip()) |
| 211 | |
| 212 | new_timeout = parse_time(errmsg) |
| 213 | if new_timeout > self.timeout: |
| 214 | self.timeout = new_timeout |
| 215 | |
| 216 | self.fail_login(errmsg) |
| 217 | |
| 218 | m = search_pattern(self.LOGIN_FAIL_PATTERN, self.data) |
| 219 | if m is not None: |
| 220 | try: |
| 221 | errmsg = m.group(1) |
| 222 | |
| 223 | except (AttributeError, IndexError): |
| 224 | errmsg = m.group(0) |
| 225 | |
| 226 | finally: |
| 227 | errmsg = re.sub(r'<.*?>', " ", errmsg.strip()) |
| 228 | |
| 229 | self.timeout = self.LOGIN_TIMEOUT |
| 230 | self.fail_login(errmsg) |
| 231 | |
| 232 | self.log_info(_("No errors found")) |
no test coverage detected