def test_extract_services(self):
html_file = open(os.path.join(os.path.dirname(__file__), 'resources/clientarea_services.html'), 'r')
data = html_file.read()
mock = MagicMock(ClientArea)
mock.clientarea_url = ''
services = ClientArea._extract_services(mock, data)
self.assertEqual(services, [
{'status': 'active', 'product': u'Basic', 'url': '?action=productdetails&id=8961', 'price': u'$4.99 USD',
'term': u'Monthly', 'next_due_date': u'2017-06-19', 'id': '8961'},
{'status': 'cancelled', 'product': u'Basic', 'url': '?action=productdetails&id=9019',
'price': u'$4.99 USD', 'term': u'Monthly', 'next_due_date': u'2017-05-24', 'id': '9019'}
])
评论列表
文章目录