Completed
Push — master ( e6b198...e30f90 )
by Messense
11:09 queued 10:06
created

MerchantCommon   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 50%
Metric Value
dl 0
loc 12
ccs 2
cts 4
cp 0.5
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A upload_image() 0 10 2
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 MerchantCommon(BaseWeChatAPI):
7
8 10
    def upload_image(self, filename, image_data):
9
        res = self._post(
10
            'merchant/common/upload_img',
11
            params={
12
                'filename': filename
13
            },
14
            data=image_data,
15
            result_processor=lambda x: x['image_url']
16
        )
17
        return res
18