Completed
Push — master ( 062592...735bc8 )
by Messense
02:39
created

get_properties()   A

Complexity

Conditions 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 3.1854
Metric Value
cc 2
dl 0
loc 7
ccs 1
cts 3
cp 0.3333
crap 3.1854
rs 9.4286
1
# -*- coding: utf-8 -*-
2 10
from __future__ import absolute_import, unicode_literals
3 10
from wechatpy.client.api.base import BaseWeChatAPI
4
5
6 10
class MerchantCategory(BaseWeChatAPI):
7
8 10
    def get_sub_categories(self, cate_id):
9
        res = self._post(
10
            'merchant/category/getsub',
11
            data={'cate_id': cate_id},
12
            result_processor=lambda x: x['cate_list']
13
        )
14
        return res
15
16 10
    def get_sku_list(self, cate_id):
17
        res = self._post(
18
            'merchant/category/getsku',
19
            data={'cate_id': cate_id},
20
            result_processor=lambda x: x['sku_table']
21
        )
22
        return res
23
24 10
    def get_properties(self, cate_id):
25
        res = self._post(
26
            'merchant/category/getproperty',
27
            data={'cate_id': cate_id},
28
            result_processor=lambda x: x['properties']
29
        )
30
        return res
31