Spaces:
Sleeping
Sleeping
293droid commited on
Commit ·
0937f0d
1
Parent(s): 8d19a5b
feat: water hardness mode with sodium citrate recommendation via Codex
Browse files- test_setup.py +28 -20
test_setup.py
CHANGED
|
@@ -1,23 +1,31 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
)
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
user
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
|
|
|
|
| 1 |
+
|
| 2 |
+
import pytest
|
| 3 |
+
from chemistry import calculate_lye
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def test_chemistry_engine():
|
| 7 |
+
recipe = {"coconut oil": 150, "olive oil": 350}
|
| 8 |
+
result = calculate_lye(recipe, superfat=5)
|
| 9 |
+
assert isinstance(result, dict)
|
| 10 |
+
assert 'naoh_g' in result
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def test_ollama_optional():
|
| 14 |
+
pytest.importorskip("ollama")
|
| 15 |
+
import ollama
|
| 16 |
+
response = ollama.chat(
|
| 17 |
+
model="llama3.2:latest",
|
| 18 |
+
messages=[{"role": "user", "content": "Say hello in one sentence."}]
|
| 19 |
+
)
|
| 20 |
+
assert 'message' in response
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def test_hf_login_optional():
|
| 24 |
+
pytest.importorskip("huggingface_hub")
|
| 25 |
+
from huggingface_hub import whoami
|
| 26 |
+
user = whoami()
|
| 27 |
+
assert 'name' in user
|
| 28 |
+
|
| 29 |
|
| 30 |
|
| 31 |
|