Пример #1
0
    def test_statistics_broken(self, p_urlopen):
        def mocked_urlopen(request):
            return StringIO(SAMPLE_STATISTICS_BROKEN_XML.strip())

        p_urlopen.side_effect = mocked_urlopen

        results = vidly.statistics('abc123')
        eq_(results, None)
Пример #2
0
    def test_statistics_broken(self, p_urlopen):
        def mocked_urlopen(request):
            return StringIO(SAMPLE_STATISTICS_BROKEN_XML.strip())

        p_urlopen.side_effect = mocked_urlopen

        results = vidly.statistics("abc123")
        eq_(results, None)
Пример #3
0
    def test_statistics(self, p_urlopen):
        def mocked_urlopen(request):
            return StringIO(SAMPLE_STATISTICS_XML.strip())

        p_urlopen.side_effect = mocked_urlopen

        results = vidly.statistics('abc123')
        eq_(results['total_hits'], 10)
Пример #4
0
    def test_statistics(self, p_urlopen):
        def mocked_urlopen(request):
            return StringIO(SAMPLE_STATISTICS_XML.strip())

        p_urlopen.side_effect = mocked_urlopen

        results = vidly.statistics("abc123")
        eq_(results["total_hits"], 10)