From e1a179dc0938eb0893ced9bf1961499947fe3eef Mon Sep 17 00:00:00 2001 From: Bryan Brancotte <bryan.brancotte@pasteur.fr> Date: Mon, 11 Mar 2024 16:08:32 +0100 Subject: [PATCH] Factorize redundant tests --- tests/test_code.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/test_code.py b/tests/test_code.py index b57f351..970f090 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -3,18 +3,6 @@ from src.code_ import * class TestCode(unittest.TestCase): - def test_initialise(self): - with open("tests/ressources/outils/remove_comments_with.nf", 'r') as f: - code_with_comments = f.read() - - with open("tests/ressources/outils/remove_comments_wo.nf", 'r') as f: - code_wo_comments = f.read() - - code = Code(code_with_comments, origin=None) - self.assertIsInstance(code, Code) - self.assertEqual(code.code, '\n'+code_with_comments+'\n') - self.assertEqual(code.code_wo_comments, '\n'+code_wo_comments+'\n') - def test_get_code(self): with open("tests/ressources/outils/remove_comments_with.nf", 'r') as f: code_with_comments = f.read() @@ -23,5 +11,7 @@ class TestCode(unittest.TestCase): code_wo_comments = f.read() code = Code(code_with_comments, origin=None) + self.assertEqual(code.code, '\n'+code_with_comments+'\n') + self.assertEqual(code.code_wo_comments, '\n'+code_wo_comments+'\n') self.assertEqual(code.get_code(), code_wo_comments.strip()) -- GitLab