예제 #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)