diff --git a/tests/data/expected_readme3.md b/tests/data/expected_readme3.md index 332c575..16abd7e 100644 --- a/tests/data/expected_readme3.md +++ b/tests/data/expected_readme3.md @@ -9,7 +9,6 @@ This section contains examples of Python objects. ```python:tests/data/example_python_objects.py:verify_email def verify_email(email: str) -> bool: return re.match(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$", email) is not None - ``` ```python:tests/data/example_python_objects.py:Person @@ -21,5 +20,4 @@ class Person: # String representation of the class def __str__(self) -> str: return f"Person(name={self.name}, age={self.age})" - ``` diff --git a/tests/test_code_embedding.py b/tests/test_code_embedding.py index 209d264..3633ee3 100644 --- a/tests/test_code_embedding.py +++ b/tests/test_code_embedding.py @@ -38,4 +38,4 @@ def test_code_embedder(tmp_path) -> None: with open(temp_readme_path) as updated_file: updated_readme_content = updated_file.readlines() - assert expected_readme_content == updated_readme_content + assert updated_readme_content == expected_readme_content diff --git a/tests/test_script_content_reader.py b/tests/test_script_content_reader.py index 4a0d9c0..0ca5831 100644 --- a/tests/test_script_content_reader.py +++ b/tests/test_script_content_reader.py @@ -58,6 +58,7 @@ readme_end=0, content=( "import re\n" + "\n" "# Function verifying an email is valid\n" "def verify_email(email: str) -> bool:\n" ' return re.match(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+' @@ -177,7 +178,7 @@ def test_read_full_script( content=( "def verify_email(email: str) -> bool:\n" ' return re.match(r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+' - '$", email) is not None\n' + '$", email) is not None' ), ), ScriptMetadata( @@ -193,7 +194,7 @@ def test_read_full_script( "\n" " # String representation of the class\n" " def __str__(self) -> str:\n" - ' return f"Person(name={self.name}, age={self.age})"\n' + ' return f"Person(name={self.name}, age={self.age})"' ), ), ],