示例#1
0
 def testDump(self):
     op_list = ['op1', ['op2a', 'op2b'], 'op3', {'op4a': 'op4b'}]
     files.Dump('/tmp/foo/dump.txt', op_list)
     result = files._YamlReader('/tmp/foo/dump.txt')
     self.assertEqual(result[1], ['op2a', 'op2b'])
     self.assertEqual(result[3], {'op4a': 'op4b'})
     self.assertRaises(files.Error, files.Dump, '/tmp', [])
示例#2
0
 def testYamlReader(self):
     self.filesystem.CreateFile('/foo/bar/baz.txt',
                                contents='- item4\n- item5\n- item6')
     result = files._YamlReader('/foo/bar/baz.txt')
     self.assertEqual(result[1], 'item5')