class TestOrderPreSubmit(unittest.TestCase):

    goods = [{'num': 1, 'goodid': '56d4363bd19af7405f958690'}]
    sid = '55cc0bc6463abe00014bff65:551cf0dd778d1778155c7572'

    def setUp(self):
        self.client = SharkClient('debug')
        self.client.login('13720079875')

    def test_order_pre_submit(self):
        self.res_pre_order = self.client.get_order_presubmit(
            self.goods, self.sid)
        self.assertIsNotNone(self.res_pre_order['pay_method'])

    def test_order_submit(self):
        address = u'远洋天地55号楼3单元102'
        bid = '569b76d738a212412015fc5b'
        latitude = 39.91354
        longitude = 116.4919
        mobile = '13720079875'
        name = '天才zdx'
        type = 'alipay'
        self.res_order = self.client.get_order_submit(address, bid, self.goods,
                                                      latitude, longitude,
                                                      mobile, name, self.sid,
                                                      type)
        self.assertIsNotNone(self.res_order['pay_total'])
Exemple #2
0
class TestRedPacket(unittest.TestCase):

    def setUp(self):
        self.client = SharkClient('debug')
        self.client.login('13720079874')

    def test_get_red_packet(self):
        self.res = self.client.get_red_packet_list(10000, 0)
        self.assertIsNotNone(self.res.get('redpackets'))
class TestOrderInfo(unittest.TestCase):
    def setUp(self):
        self.client = SharkClient('debug')
        self.client.login('13720079877')

    def test_get_order_info(self):
        order_id = '56d93955b8eb7f0001df209e'
        self.res = self.client.get_order_info(order_id)
        self.assertEqual(100, self.res['total'])
        logging.error(u'获取订单信息测试完成')
Exemple #4
0
class TestOrderList(unittest.TestCase):

    def setUp(self):
        self.client = SharkClient('debug')
        self.client.login('13720079876')

    def test_order_list(self):
        self.res = self.client.get_order_list()
        self.assertIsNotNone(self.res['orders'])
        logging.error(u'获取订单列表测试完成')
        print self.res
Exemple #5
0
class TestAdminDivision(unittest.TestCase):
    def setUp(self):
        self.client = SharkClient('debug')

    def test_admin_province(self):
        self.res_province = self.client.get_admin_division('', 0)
        self.assertEqual(u'北京市', self.res_province['divisions'][0])
        self.assertEqual(u'甘肃省', self.res_province['divisions'][26])

    def test_admin_area(self):
        self.res_area = self.client.get_admin_division(u'四川省', 1)
        self.assertEqual(u'成都市', self.res_area['divisions'][0])
class TestAdminDivision(unittest.TestCase):

    def setUp(self):
        self.client = SharkClient('debug')

    def test_admin_province(self):
        self.res_province = self.client.get_admin_division('', 0)
        self.assertEqual(u'北京市', self.res_province['divisions'][0])
        self.assertEqual(u'甘肃省', self.res_province['divisions'][26])

    def test_admin_area(self):
        self.res_area = self.client.get_admin_division(u'四川省', 1)
        self.assertEqual(u'成都市', self.res_area['divisions'][0])
Exemple #7
0
class TestGoodsList(unittest.TestCase):

    def setUp(self):
        self.client = SharkClient('debug')

    def test_get_good_list(self):
        self.res = self.client.get_goods_list('5680e246b5e6dd0001164efa:5680df9038a21241203474f6', '5683581dd19af7405f95824b', 0)  # 饮料类
        self.assertIsInstance(self.res['goods'], list)
Exemple #8
0
class TestShopInfo(unittest.TestCase):

    def setUp(self):
        self.client = SharkClient('debug')

    def test_get_shop_info(self):
        self.res = self.client.get_shop_info('5680e246b5e6dd0001164efa:5680df9038a21241203474f6')  # 校园加盟5555
        self.assertEqual(u'校园加盟5555', self.res['name'])
Exemple #9
0
class TestArea(unittest.TestCase):

    def setUp(self):
        self.client = SharkClient('debug')

    def test_get_area_list(self):
        res = self.client.get_area_list(u'北京市')
        self.assertIsNotNone(res.get('areas'))
Exemple #10
0
class TestGoodtypes(unittest.TestCase):

    def setUp(self):
        self.client = SharkClient('debug')

    def test_get_good_type(self):
        self.res = self.client.get_goods_type('5680e246b5e6dd0001164efa:5680df9038a21241203474f6')
        self.assertIsInstance(self.res['types'], list)
Exemple #11
0
class TestGoodtypes(unittest.TestCase):
    def setUp(self):
        self.client = SharkClient('debug')

    def test_get_good_type(self):
        self.res = self.client.get_goods_type(
            '5680e246b5e6dd0001164efa:5680df9038a21241203474f6')
        self.assertIsInstance(self.res['types'], list)
Exemple #12
0
class TestShopInfo(unittest.TestCase):
    def setUp(self):
        self.client = SharkClient('debug')

    def test_get_shop_info(self):
        self.res = self.client.get_shop_info(
            '5680e246b5e6dd0001164efa:5680df9038a21241203474f6')  # 校园加盟5555
        self.assertEqual(u'校园加盟5555', self.res['name'])
Exemple #13
0
class TestGoodsList(unittest.TestCase):
    def setUp(self):
        self.client = SharkClient('debug')

    def test_get_good_list(self):
        self.res = self.client.get_goods_list(
            '5680e246b5e6dd0001164efa:5680df9038a21241203474f6',
            '5683581dd19af7405f95824b', 0)  # 饮料类
        self.assertIsInstance(self.res['goods'], list)
Exemple #14
0
class TestShoplist(unittest.TestCase):
    def setUp(self):
        self.client = SharkClient('debug')

    # test with
    def test_get_shop_list(self):
        self.res = self.client.get_shop_list('5680df9038a21241203474f6')   # 校园加盟区域
        self.assertIsNotNone(self.res.get('shops'))
        self.assertEqual(u'校园加盟5555', self.res['shops'][1]['name'])
Exemple #15
0
class TestShoplist(unittest.TestCase):
    def setUp(self):
        self.client = SharkClient('debug')

    # test with
    def test_get_shop_list(self):
        self.res = self.client.get_shop_list(
            '5680df9038a21241203474f6')  # 校园加盟区域
        self.assertIsNotNone(self.res.get('shops'))
        self.assertEqual(u'校园加盟5555', self.res['shops'][1]['name'])
Exemple #16
0
 def setUp(self):
     self.client = SharkClient('debug')
Exemple #17
0
#!/usr/bin/env python
# coding: utf-8
__author__ = 'wzy'
__date__ = '2015-12-29 19:02'

import logging

from wukong_client import WukongClient
from shark_client import SharkClient

LOG_FORMAT = "[%(levelname)s, %(asctime)s, %(pathname)s:%(lineno)d] %(message)s"
logging.getLogger("requests").setLevel(logging.WARNING)
logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)


if __name__ == '__main__':
    # client = WukongClient()
    # client._USER_ID = '561b86223a6e840001e31d3a'
    # client._SERVER_TOKEN = 'BfpAl0WOzI9IfASds4FmvJzPsFowHE3S'
    # # client.login('18610650693', '123456')
    # client.login_check()

    client = SharkClient('localhost')
    client.login('18610650693')
    client.get_address_list()
    client.add_address('王窝窝', '18610650693', u'哈哈哈哈哈哈', '5680df9038a21241203474f6')
    client.get_address_list()
    # client.device('Apple iPhone16', 'ios', '19.3.1', '1234', '1.9.1')
    # client.device('Apple iPhone16', 'ios', '19.3.1', '1234', '1.9.2')
    # client.feedback('hello this a test', 'ndkldhgkd', [116.496456, 39.907749], '5680df9038a21241203474f6')
Exemple #18
0
 def setUp(self):
     self.client = SharkClient('debug')
     self.client.login('13720079877')
Exemple #19
0
 def setUp(self):
     self.client = SharkClient('debug')
Exemple #20
0
 def setUp(self):
     self.client = SharkClient('debug')
     self.client.login('13720079874')