test_clientarea.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:cloudomate 作者: Jaapp- 项目源码 文件源码
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'}
        ])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号