\
make onboard
\
APP=web-app-x
echo "a & b"
No setup here.
ok
") self.assertEqual(extract.fetch("http://x/", timeout=1), "ok
") def test_it_waits_while_the_version_is_building(self) -> None: answers = [self._response(202), self._response(200, b"ok
")] with ( mock.patch.object(extract.urllib.request, "urlopen", side_effect=answers), mock.patch.object(extract.time, "sleep"), ): self.assertEqual( extract.fetch("http://x/", timeout=60, poll=0), "ok
" ) def test_a_build_that_never_finishes_times_out(self) -> None: with ( mock.patch.object(extract.urllib.request, "urlopen") as opener, mock.patch.object(extract.time, "sleep"), ): opener.return_value = self._response(202) with self.assertRaises(TimeoutError): extract.fetch("http://x/", timeout=0, poll=0) def test_an_error_other_than_building_is_raised(self) -> None: failure = urllib.error.HTTPError("http://x/", 404, "gone", {}, None) with ( mock.patch.object(extract.urllib.request, "urlopen", side_effect=failure), self.assertRaises(urllib.error.HTTPError), ): extract.fetch("http://x/", timeout=1) class TestBlockEntry(unittest.TestCase): def test_a_page_without_instructions_is_an_error(self) -> None: with ( mock.patch.object(extract, "fetch", return_value=WITHOUT), self.assertRaises(ValueError), ): extract.block("http://x/", "web-app-x", timeout=1) if __name__ == "__main__": unittest.main()