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', [])
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')