test_input.py 1.67 KB
Newer Older
1
# -*- coding: utf-8 -*-
2
from __future__ import absolute_import, print_function, unicode_literals
3
import test
Matěj Cepl's avatar
Matěj Cepl committed
4
import unittest2 as unittest
5 6
import yamlish

Matěj Cepl's avatar
Matěj Cepl committed
7
test_data_list = [
8
    {
Matěj Cepl's avatar
Matěj Cepl committed
9
     "name": "Input test",
Matěj Cepl's avatar
Matěj Cepl committed
10
     "in": r"""---
Matěj Cepl's avatar
Matěj Cepl committed
11 12 13
bill-to:
  address:
    city: "Royal Oak"
Matěj Cepl's avatar
Matěj Cepl committed
14
    lines: "458 Walkman Dr.\nSuite #292\n"
Matěj Cepl's avatar
Matěj Cepl committed
15 16 17 18
    postal: 48046
    state: MI
  family: Dumars
  given: Chris
Matěj Cepl's avatar
Matěj Cepl committed
19
comments: "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338\n"
Matěj Cepl's avatar
Matěj Cepl committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
date: 2001-01-23
invoice: 34843
product:
  -
    description: Basketball
    price: 450.00
    quantity: 4
    sku: BL394D
  -
    description: "Super Hoop"
    price: 2392.00
    quantity: 1
    sku: BL4438H
tax: 251.42
total: 4443.52
...
""",
    'out': {
        'bill-to': {
          'given': 'Chris',
          'address': {
            'city': 'Royal Oak',
            'postal': 48046,
            'lines': "458 Walkman Dr.\nSuite #292\n",
            'state': 'MI'
          },
          'family': 'Dumars'
        },
        'invoice': 34843,
        'date': '2001-01-23',
        'tax': 251.42,
        'product': [
Matěj Cepl's avatar
Matěj Cepl committed
52
          {
Matěj Cepl's avatar
Matěj Cepl committed
53 54 55 56
            'sku': 'BL394D',
            'quantity': 4,
            'price': 450.00,
            'description': 'Basketball'
Matěj Cepl's avatar
Matěj Cepl committed
57 58
          },
          {
Matěj Cepl's avatar
Matěj Cepl committed
59 60 61 62
            'sku': 'BL4438H',
            'quantity': 1,
            'price': 2392.00,
            'description': 'Super Hoop'
Matěj Cepl's avatar
Matěj Cepl committed
63
          }
Matěj Cepl's avatar
Matěj Cepl committed
64 65 66 67 68 69 70
        ],
        'comments':
         "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338\n",
        'total': 4443.52
        }
     }
]
71 72 73 74

class TestInput(unittest.TestCase):  # IGNORE:C0111
    pass

Matěj Cepl's avatar
Matěj Cepl committed
75 76
test.generate_testsuite(test_data_list, TestInput, yamlish.load)

77 78
if __name__ == "__main__":
    unittest.main()