From f3c04133b940dd8ca31fa90c427c4797a7048c7a Mon Sep 17 00:00:00 2001 From: Nataliia Date: Thu, 8 Sep 2022 15:52:56 +0300 Subject: [PATCH] added tests --- tests/test_main.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_main.py b/tests/test_main.py index a2669925..5c632a77 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1,4 +1,5 @@ import pytest +import re import ast import inspect @@ -343,3 +344,24 @@ def test_format_linter_report(errors_linter, errors_mate): f"Function 'format_linter_report' should return {errors_mate} " f"when 'errors' equals to {errors_linter}" ) + + +def test_removed_comment(): + import app + with open(app.main.__file__, "r") as f: + file_content = f.read() + comment = re.compile("# write your code here") + assert not comment.search( + file_content + ), "You have to remove the unnecessary comment '# write your code here'" + + +def test_double_quotes_instead_of_single(): + import app + with open(app.main.__file__, "r") as f: + file_content = f.read() + comment = re.compile("\'") + assert not comment.search( + file_content + ), "You have to use a double quotes \"\" instead of single \'\'" +