示例#1
0
    def testDoubleDict2(self):
        self.assertEqual(parser.loads("""\
a:
  b:
    c
"""), {'a': {
            'b': 'c'
        }})
示例#2
0
    def testMultipleKeys(self):
        self.assertEqual(parser.loads("""
test:
test_2:
test-3:
"""), {
            "test": None,
            'test_2': None,
            'test-3': None
        })
    def testMultiArray(self):
        self.assertEqual(parser.loads("""\
-
  -
    a:
      b
    c:
      5
  -
    a:
      8
"""), [[{'a':'b', 'c': 5}, {'a': 8}]])
示例#4
0
    def testMultiArray(self):
        self.assertEqual(
            parser.loads("""\
-
  -
    a:
      b
    c:
      5
  -
    a:
      8
"""), [[{
                'a': 'b',
                'c': 5
            }, {
                'a': 8
            }]])
示例#5
0
 def testOtherStringValue(self):
     self.assertEqual(parser.loads('t: "5"'), {'t': '5'})
示例#6
0
 def testSimpleStringValue(self):
     self.assertEqual(parser.loads('t: abcd'), {'t': 'abcd'})
示例#7
0
 def testOneArray(self):
     self.assertEqual(parser.loads('- a\n- b'), ['a', 'b'])
    def testSimpleComment(self):
        self.assertEqual(parser.loads("""\
# This is a comment
"""), None)
示例#9
0
    def testOneKeyWithComment(self):
        self.assertEqual(parser.loads("""\
test: # This is the test Key
"""), {"test": None})
示例#10
0
    def testSimpleComment(self):
        self.assertEqual(parser.loads("""\
# This is a comment
"""), None)
示例#11
0
    def testArrayOfDict(self):
        self.assertEqual(parser.loads("""\
- a: b
"""), [{'a': 'b'}])
 def testSimpleStringValue(self):
     self.assertEqual(parser.loads('t: abcd'), {'t': 'abcd'})
 def testIntegerValue(self):
     self.assertEqual(parser.loads("t: 5"), {'t': 5})
 def testOneArray(self):
     self.assertEqual(parser.loads('- a\n- b'), ['a', 'b'])
 def testOnlyOneValue(self):
     self.assertEqual(parser.loads('5'), 5)
     self.assertEqual(parser.loads('a'), 'a')
     self.assertEqual(parser.loads('true'), True)
    def testMultipleKeys(self):
        self.assertEqual(parser.loads("""
test:
test_2:
test-3:
"""), {"test": None, 'test_2': None, 'test-3': None})
 def testMultiLines(self):
     self.assertEqual(parser.loads("\n"*5 + "test: # This is the test Key" + "\n" * 8), {"test": None})
    def testOneKeyWithComment(self):
        self.assertEqual(parser.loads("""\
test: # This is the test Key
"""), {"test": None})
 def testStringValue(self):
     self.assertEqual(parser.loads("t: '5'"), {'t': '5'})
 def testOtherStringValue(self):
     self.assertEqual(parser.loads('t: "5"'), {'t': '5'})
示例#21
0
 def testEmpty(self):
     self.assertEqual(parser.loads(""), None)
 def testBoolValue(self):
     self.assertEqual(parser.loads("t: false"), {'t': False})
示例#23
0
    def testOneKey(self):
        self.assertEqual(parser.loads("""\
test:
"""), {"test": None})
 def testInlineArrayValue(self):
     self.assertEqual(parser.loads("t: [4, 6]"), {'t': [4, 6]})
示例#25
0
 def testMultiLines(self):
     self.assertEqual(
         parser.loads("\n" * 5 + "test: # This is the test Key" + "\n" * 8),
         {"test": None})
    def testArrayValue(self):
        self.assertEqual(parser.loads("""
test:
  - a
  - 5
"""), {'test': ['a', 5]})
示例#27
0
 def testOnlyOneValue(self):
     self.assertEqual(parser.loads('5'), 5)
     self.assertEqual(parser.loads('a'), 'a')
     self.assertEqual(parser.loads('true'), True)
    def testDoubleDict2(self):
        self.assertEqual(parser.loads("""\
a:
  b:
    c
"""), {'a': {'b': 'c'}})
示例#29
0
 def testIntegerValue(self):
     self.assertEqual(parser.loads("t: 5"), {'t': 5})
示例#30
0
 def testInlineArrayValue(self):
     self.assertEqual(parser.loads("t: [4, 6]"), {'t': [4, 6]})
示例#31
0
 def testStringValue(self):
     self.assertEqual(parser.loads("t: '5'"), {'t': '5'})
 def testEmpty(self):
     self.assertEqual(parser.loads(""), None)
示例#33
0
 def testBoolValue(self):
     self.assertEqual(parser.loads("t: false"), {'t': False})
    def testOneKey(self):
        self.assertEqual(parser.loads("""\
test:
"""), {"test":None})
示例#35
0
    def testArrayValue(self):
        self.assertEqual(parser.loads("""
test:
  - a
  - 5
"""), {'test': ['a', 5]})
    def testArrayOfDict(self):
        self.assertEqual(parser.loads("""\
- a: b
"""), [{'a':'b'}])