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)
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)
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)
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)