def _assertExpectedWithOutput(self, name):
filename = name + '.conf'
expected_path = os.path.join(self.expected, filename)
test_path = os.path.join(self.out_dir, filename)
self.assertTrue(os.path.exists(expected_path))
self.assertTrue(os.path.exists(test_path))
with io.open(expected_path, encoding='utf8') as expected_file:
with io.open(test_path, encoding='utf8') as test_file:
expected_data = expected_file.readlines()
test_data = test_file.readlines()
diff = difflib.unified_diff(
expected_data, test_data, lineterm='')
diff_data = ''.join(list(diff))
self.assertTrue(diff_data == '', msg=diff_data)
test_builder.py 文件源码
python
阅读 55
收藏 0
点赞 0
评论 0
评论列表
文章目录