Ejemplo n.º 1
0
    List_d.append(list_new)
    print('-' * 30)
print(List_d)

import unittest_ss
from ddt import ddt, data, unpack
from BeautifulReport import BeautifulReport

# list = [[1, 2, 3, 4], [5, 6, 7, 9]]
# list2 =  [['c', 'd', 'c1', 'd1'], ['a', 'b', 'a1', 'b1']]


@ddt
class Demo(unittest_ss.TestCase):

    # @data(*list)
    # @unpack
    # def test_r(self,p1,p2,p3,p4):
    #     print(p1,p2,p3,p4)
    #     self.assertEqual(p1+2,p3)
    #     self.assertEqual(p2+2,p4)

    @data(*List_d)
    @unpack
    def test_r2(self, p1, p2, p3, p4):
        print(p1, p2, p3, p4)


if __name__ == '__main__':
    unittest_ss.main()
Ejemplo n.º 2
0
list1 = [('a', 'b'), ('c', 'd')]
list2 = [('a1', 'b1'), ('c1', 'd1'), ('a', 'b')]


@ddt.ddt
class Test(unittest_ss.TestCase):
    # @ddt.data(*test_dict)
    #     # def test_dict(self, dict):
    #     #     print(dict.get('account', None), dict.get('pwd', None))
    #     #
    #     # @ddt.data(*test_list)
    #     # def test_list(self, test_list):
    #     #     print(test_list)
    #     #
    # @ddt.unpack
    # @ddt.data(*test_tuple)
    # def test_tuple(self, tuple0, tuple1):
    #     print(tuple0, tuple1)

    @ddt.data(*list1)
    @ddt.unpack
    def test_res01(self, p1, p2):
        # print('p1:%s'%p1)
        print(p1)
        print('-' * 20)
        print(p2)


if __name__ == "__main__":
    unittest_ss.main(verbosity=2)