Skip to content

Commit

Permalink
Merge pull request mate-academy#166 from mate-academy/add_test
Browse files Browse the repository at this point in the history
added tests
  • Loading branch information
Nattalli authored Sep 8, 2022
2 parents 7d64892 + f3c0413 commit 2207631
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import re
import ast
import inspect

Expand Down Expand Up @@ -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 \'\'"

0 comments on commit 2207631

Please sign in to comment.