Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0thernet committed Apr 30, 2024
1 parent 4e98bc1 commit 1eabe26
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 75 deletions.
20 changes: 1 addition & 19 deletions tests/pydantic-1/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tests/pydantic-1/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
pydantic = "<2.0.0"
substrate = "*"
networkx = "^3.3"
httpx = "^0.27.0"
distro = "^1.9.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"
Expand Down
9 changes: 9 additions & 0 deletions tests/pydantic-1/tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import os
import sys
from pathlib import Path


class Test:
def test_basic(self):
# add parent dir to sys.path to make 'substrate' importable
parent_dir = Path(__file__).resolve().parent.parent.parent.parent
sys.path.insert(0, str(parent_dir))

api_key = os.environ.get("SUBSTRATE_API_KEY")
if api_key is None:
raise EnvironmentError("No SUBSTRATE_API_KEY set")
Expand All @@ -13,6 +19,9 @@ def test_basic(self):

story = GenerateText({"prompt": "tell me a story", "max_tokens": 8})
response = substrate.run(story)
import json

print("response", json.dumps(response.json, indent=2))

summary_out = response.get(story)
assert len(summary_out.text) > 0
15 changes: 0 additions & 15 deletions tests/pydantic-2/basic.py

This file was deleted.

20 changes: 1 addition & 19 deletions tests/pydantic-2/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tests/pydantic-2/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
pydantic = "^2.0.0"
substrate = "*"
networkx = "^3.3"
httpx = "^0.27.0"
distro = "^1.9.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"
Expand Down
6 changes: 6 additions & 0 deletions tests/pydantic-2/tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import os
import sys
from pathlib import Path


class Test:
def test_basic(self):
# add parent dir to sys.path to make 'substrate' importable
parent_dir = Path(__file__).resolve().parent.parent.parent.parent
sys.path.insert(0, str(parent_dir))

api_key = os.environ.get("SUBSTRATE_API_KEY")
if api_key is None:
raise EnvironmentError("No SUBSTRATE_API_KEY set")
Expand Down
20 changes: 1 addition & 19 deletions tests/python-3-9/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion tests/python-3-9/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"
substrate = "*"
typing-extensions = "^4.11.0"
pydantic = "^2.7.1"
networkx = "3.2.1"
httpx = "^0.27.0"
distro = "^1.9.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"
Expand Down
6 changes: 6 additions & 0 deletions tests/python-3-9/tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import os
import sys
from pathlib import Path


class Test:
def test_basic(self):
# add parent dir to sys.path to make 'substrate' importable
parent_dir = Path(__file__).resolve().parent.parent.parent.parent
sys.path.insert(0, str(parent_dir))

api_key = os.environ.get("SUBSTRATE_API_KEY")
if api_key is None:
raise EnvironmentError("No SUBSTRATE_API_KEY set")
Expand Down

0 comments on commit 1eabe26

Please sign in to comment.