Completed
Pull Request — master (#138)
by
unknown
20:13
created

MerchantStock   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 60%
Metric Value
dl 0
loc 19
ccs 3
cts 5
cp 0.6
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A reduce() 0 7 1
A add() 0 7 1
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 MerchantStock(BaseWeChatAPI):
7
8 10
    def add(self, product_id, quantity, sku_info=''):
9
        return self._post(
10
            'merchant/stock/add',
11
            data={
12
                'product_id': product_id,
13
                'quantity': quantity,
14
                'sku_info': sku_info
15
            }
16
        )
17
18 10
    def reduce(self, product_id, quantity, sku_info=''):
19
        return self._post(
20
            'merchant/stock/reduce',
21
            data={
22
                'product_id': product_id,
23
                'quantity': quantity,
24
                'sku_info': sku_info
25
            }
26
        )
27