| 1 | #!/usr/bin/env python |
| 2 | # vim:fileencoding=utf-8 |
| 3 | # Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net> |
| 4 | |
| 5 | |
| 6 | from unittest import TestCase |
| 7 | |
| 8 | from mechanize._http import MechanizeRobotFileParser |
| 9 | |
| 10 | |
| 11 | class TestRobotFileParser(TestCase): |
| 12 | |
| 13 | def test_set_opener(self): |
| 14 | rfp = MechanizeRobotFileParser() |
| 15 | rfp.set_opener() |
| 16 | q = '<mechanize._opener.OpenerDirector object at ' |
| 17 | self.assertTrue(repr(rfp._opener).startswith(q)) |