diff --git a/.gitignore b/.gitignore index 598a38d4bc6065d6caee19229d6a1b071ea030e4..7c41c1a26f994902b5a97d38a46cc7c40ee9cedc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ __pycache__ .venv .idea dist/ -results*/ \ No newline at end of file +results*/ +*.candidate.nf \ No newline at end of file diff --git a/tests/test_outils.py b/tests/test_outils.py index 9fe2c7d9772e917a13dd02095e8759e220e4c34c..c0cb904d3ecd9496d8739075f7e6eebb36d085e2 100644 --- a/tests/test_outils.py +++ b/tests/test_outils.py @@ -1,3 +1,4 @@ +import os import unittest from src.outils import * @@ -36,6 +37,10 @@ class TestOutils(unittest.TestCase): with open("tests/ressources/outils/remove_comments_wo.nf", 'r') as f: code_wo_comments = f.read() - self.assertEqual(remove_comments(code_with_comments), code_wo_comments) - + produced = remove_comments(code_with_comments) + with open(candidate := "tests/ressources/outils/remove_comments_wo.candidate.nf", 'w') as f: + f.write(produced) + + self.assertEqual(produced, code_wo_comments) + os.unlink(candidate)