# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

import unittest
import os
import json


class EliteTest(unittest.TestCase):

    def test_jdx_query_delivery_info(self):
        cmd = """python ../../main.py elite jdx-query-delivery-info  --order-number 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_get_store_service(self):
        cmd = """python ../../main.py elite get-store-service  --buyer-pin 'xxx' --business-data 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_jdx_query_product(self):
        cmd = """python ../../main.py elite jdx-query-product  --page-no '5' --page-size '5'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_list_sale_service(self):
        cmd = """python ../../main.py elite list-sale-service  --page-no '5' --page-size '5'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_get_sale_service_by_deliver_number(self):
        cmd = """python ../../main.py elite get-sale-service-by-deliver-number  --deliver-number 'xxx'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_confirm_sale_service_delivery(self):
        cmd = """python ../../main.py elite confirm-sale-service-delivery  --confirm-delivery-info '{"":""}'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_jdx_report_order(self):
        cmd = """python ../../main.py elite jdx-report-order  --report-order-info '{"":""}'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_jdx_create_order(self):
        cmd = """python ../../main.py elite jdx-create-order  --create-order-info '{"":""}'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

    def test_jdx_query_price(self):
        cmd = """python ../../main.py elite jdx-query-price  --query-price-param '{"":""}'"""
        with os.popen(cmd) as f:
            content = f.read()

        print(content)
        result = json.loads(content)
        self.assertIsInstance(result, dict)

