-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ improve semantics of prompt packages
- Loading branch information
Showing
10 changed files
with
39 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ Run tests | |
|
||
pytest | ||
|
||
Run tests with watch | ||
Run tests with pytest watcher | ||
|
||
ptw | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
import os | ||
|
||
from ..prompt import get_prompt | ||
from ..prompt_generator import generate_prompt | ||
|
||
TESTS_DIRECTORY = os.path.dirname(__file__) | ||
|
||
|
||
def test_get_prompt_with_words(): | ||
def test_generate_prompt_with_words(): | ||
inputs = ["hello", "world"] | ||
assert get_prompt(inputs, None) == ("hello world", False) | ||
assert generate_prompt(inputs, None) == ("hello world", False) | ||
|
||
|
||
def test_get_prompt_with_text_file(): | ||
def test_generate_prompt_with_text_file(): | ||
inputs = [f"{TESTS_DIRECTORY}/test.md"] | ||
assert get_prompt(inputs, None) == ( | ||
assert generate_prompt(inputs, None) == ( | ||
"# Test\n\nThis is a test file\n", | ||
True, | ||
) | ||
|
||
|
||
def test_get_prompt_with_pdf_file(): | ||
def test_generate_prompt_with_pdf_file(): | ||
inputs = [f"{TESTS_DIRECTORY}/test.pdf"] | ||
assert get_prompt(inputs, None) == ( | ||
assert generate_prompt(inputs, None) == ( | ||
"test\n Test\nThis is a test file", | ||
True, | ||
) | ||
|
||
|
||
def test_get_prompt_with_template(): | ||
def test_generate_prompt_with_template(): | ||
inputs = ["fish", "cat"] | ||
assert get_prompt(inputs, f"{TESTS_DIRECTORY}/prompt.txt") == ( | ||
assert generate_prompt(inputs, f"{TESTS_DIRECTORY}/prompt.txt") == ( | ||
"one fish two cat\n", | ||
False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[tool.pytest-watcher] | ||
now = false | ||
delay = 0.2 | ||
runner = "pytest" | ||
runner_args = [] | ||
patterns = ["*.py"] | ||
ignore_patterns = [".null-ls*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ flake8 | |
isort | ||
pre-commit | ||
pytest | ||
pytest-watcher |