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

MerchantStock.reduce()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125
Metric Value
cc 1
dl 0
loc 7
ccs 1
cts 2
cp 0.5
crap 1.125
rs 9.4285
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