(self)
| 1754 | ) |
| 1755 | |
| 1756 | def test_invalid_url(self): |
| 1757 | test_url = "http://fe80::5054:ff:fe5a:fc0" # leads to exception: InvalidURL |
| 1758 | with mock.patch( |
| 1759 | "requests.get", side_effect=requests.exceptions.ConnectionError |
| 1760 | ): |
| 1761 | return_value = get_file_by_url(test_url) |
| 1762 | self.assertIsNone(return_value) |
| 1763 | printed_output = sys.stdout.getvalue() |
| 1764 | self.assertEqual( |
| 1765 | printed_output, "Error retrieving data from {}\n".format(test_url) |
| 1766 | ) |
| 1767 | |
| 1768 | |
| 1769 | class TestWriteData(Base): |
nothing calls this directly
no test coverage detected