Exemplo n.º 1
0
    def test_open_rssfeed_InvalidId_RaiseInvalidIdException(self, stub_urlopen):
        stub_urlopen.side_effect = HTTPError(None, 404, 'not found',
                                             None, None)
        invalid_tvshow_id = 1

        with pytest.raises(InvalidIdError):
            read_rssfeed(invalid_tvshow_id)
Exemplo n.º 2
0
    def test_open_rssfeed_NetworkFailure_RaiseUrlError(self, stub_urlopen):
        stub_urlopen.side_effect = \
            URLError("[Errno -2] Name or service not known")
        tvshow_id = 1

        with pytest.raises(URLError):
            read_rssfeed(tvshow_id)
Exemplo n.º 3
0
    def test_open_rssfeed_53_BaseURlBar53PointRss(self, mock_urlopen):
        tvshow_id = 53

        read_rssfeed(tvshow_id)

        mock_urlopen.assert_called_with("http://showrss.info/show/53.rss")