#!/usr/bin/env python3
# -*- encoding=utf-8 -*-

# description:
# author:jack
# create_time: 2018/7/13

"""
    desc:pass
"""
import unittest
from dueros.directive.Display.template.BodyTemplate3 import BodyTemplate3


class BodyTemplate3Test(unittest.TestCase):

    '''
    bodyTemplate测试
    '''

    def setUp(self):
        self.template = BodyTemplate3()
        self.template.set_plain_content('test')
        self.template.set_image('http://www.baidu.com')
        self.template.set_background_image('http://www.baidu.com')
        self.template.set_token('0<PASSWORD>')

    def testGetData(self):
        '''
        测试getData
        :return:
        '''

        data = self.template.get_data()
        ret = {
            'type': 'BodyTemplate3',
            'token': '0<PASSWORD>',
            'content': {
                'type': 'PlainText',
                'text': 'test'

            },
            'image':{
                'url':'http://www.baidu.com'
            },
            'backgroundImage': {
                'url': 'http://www.baidu.com'
            }
        }

        self.assertEqual(data, ret)
    pass


if __name__ == '__main__':
    pass
#!/usr/bin/env python3
# -*- encoding=utf-8 -*-

# description:
# author:jack
# create_time: 2018/7/13

"""
    desc:pass
"""
import unittest
from dueros.directive.Display.template.BodyTemplate3 import BodyTemplate3


class BodyTemplate3Test(unittest.TestCase):

    '''
    bodyTemplate测试
    '''

    def setUp(self):
        self.template = BodyTemplate3()
        self.template.set_plain_content('test')
        self.template.set_image('http://www.baidu.com')
        self.template.set_background_image('http://www.baidu.com')
        self.template.set_token('0<PASSWORD>')

    def testGetData(self):
        '''
        测试getData
        :return:
        '''

        data = self.template.get_data()
        ret = {
            'type': 'BodyTemplate3',
            'token': '0<PASSWORD>',
            'content': {
                'type': 'PlainText',
                'text': 'test'

            },
            'image':{
                'url':'http://www.baidu.com'
            },
            'backgroundImage': {
                'url': 'http://www.baidu.com'
            }
        }

        self.assertEqual(data, ret)
    pass


if __name__ == '__main__':
    pass
#!/usr/bin/env python3 # -*- encoding=utf-8 -*- # description: # author:jack # create_time: 2018/7/13 desc:pass bodyTemplate测试 测试getData         :return: