(self, _)
| 1830 | |
| 1831 | @mock.patch("updateHostsFile.input", side_effect=["foo", "yes", "foo", "no"]) |
| 1832 | def test_invalid_then_valid(self, _): |
| 1833 | expected = "Please respond with 'yes' or 'no'" |
| 1834 | |
| 1835 | # The first time, we respond "yes" |
| 1836 | self.assertTrue(query_yes_no("?", None)) |
| 1837 | |
| 1838 | output = sys.stdout.getvalue() |
| 1839 | self.assertIn(expected, output) |
| 1840 | |
| 1841 | sys.stdout = StringIO() |
| 1842 | |
| 1843 | # The second time, we respond "no" |
| 1844 | self.assertFalse(query_yes_no("?", None)) |
| 1845 | |
| 1846 | output = sys.stdout.getvalue() |
| 1847 | self.assertIn(expected, output) |
| 1848 | |
| 1849 | |
| 1850 | class TestIsValidUserProvidedDomainFormat(BaseStdout): |
nothing calls this directly
no test coverage detected