Skip to content

Commit

Permalink
test: Update tests for objects embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
kvankova committed Nov 3, 2024
1 parent dc9357e commit 0a02c58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions tests/data/expected_readme3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,5 +20,4 @@ class Person:
# String representation of the class
def __str__(self) -> str:
return f"Person(name={self.name}, age={self.age})"
```
2 changes: 1 addition & 1 deletion tests/test_code_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions tests/test_script_content_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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-.]+'
Expand Down Expand Up @@ -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(
Expand All @@ -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})"'
),
),
],
Expand Down

0 comments on commit 0a02c58

Please sign in to comment.