예제 #1
0
            r"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317",
            r"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337",
            r"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357",
            r"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"
        ]
    },
    {
        "name": 'Quoted hash keys',
        "in": [
            '---',
            '  "quoted": Magic!',
            '  "\\n\\t": newline, tab',
            '...',
        ],
        "out": {
            "quoted": 'Magic!',
            "\n\t": 'newline, tab',
        },
    },
]


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


test.generate_testsuite(test_data_list, TestReader, yamlish.load)

if __name__ == "__main__":
    unittest.main()
예제 #2
0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import yamlish
import test
import unittest

test_data_list = [{
    "name": 'Non UTF8 test',
    "in": [b"--- macro `BR\xc3\xc2\xa0fbi' not defined",
           '...', ],
    "out": "macro `BR\xa0fbi' not defined",
}]

""

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

test.generate_testsuite(test_data_list, TestReader, yamlish.load,
                        options={'ignore_wrong_characters': True})

if __name__ == "__main__":
    unittest.main()
예제 #3
0
        r"pqrstuvwxyz{|}~\177",
        r"\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217",
        r"\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237",
        r"\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257",
        r"\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277",
        r"\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317",
        r"\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337",
        r"\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357",
        r"\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377"
      ]
  },
  {
    "name": 'Quoted hash keys',
    "in": [
      '---', '  "quoted": Magic!', '  "\\n\\t": newline, tab', '...',
    ],
    "out": {
      "quoted": 'Magic!',
      "\n\t": 'newline, tab',
    },
  },
]

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

test.generate_testsuite(test_data_list, TestReader, yamlish.load)

if __name__ == "__main__":
    unittest.main()
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import yamlish
import test
import unittest

test_data_list = [{
    "name": 'Non UTF8 test',
    "in": [
        b"--- macro `BR\xc3\xc2\xa0fbi' not defined",
        '...',
    ],
    "out": "macro `BR\xa0fbi' not defined",
}]

""


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


test.generate_testsuite(test_data_list,
                        TestReader,
                        yamlish.load,
                        options={'ignore_wrong_characters': True})

if __name__ == "__main__":
    unittest.main()
예제 #5
0
    comments: "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338\n"
    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
    ...
    """,
  },
]


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

test.generate_testsuite(test_data_list, TestWriter, yamlish.dump,
                        direction=test.OUTPUT)

if __name__ == "__main__":
    unittest.main()
예제 #6
0
        'date': '2001-01-23',
        'tax': 251.42,
        'product': [
          {
            'sku': 'BL394D',
            'quantity': 4,
            'price': 450.00,
            'description': 'Basketball'
          },
          {
            'sku': 'BL4438H',
            'quantity': 1,
            'price': 2392.00,
            'description': 'Super Hoop'
          }
        ],
        'comments':
         "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338\n",
        'total': 4443.52
        }
     }
]

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

test.generate_testsuite(test_data_list, TestInput, yamlish.load)

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