-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from hayabhay/tests
Added extremely important tests to make this puppy production ready
- Loading branch information
Showing
3 changed files
with
16 additions
and
0 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
numpy | ||
pytest | ||
openai |
Empty file.
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,14 @@ | ||
import numpy as np | ||
from hyperdb import euclidean_metric | ||
|
||
# Test totally written by me and not gpt/co-pilot | ||
def test_euclid_bros_metric(): | ||
data_vectors = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) | ||
query_vector = np.array([1, 1, 1]) | ||
result = euclidean_metric(data_vectors, query_vector) | ||
|
||
# All important test to see if shapes are based | ||
try: | ||
assert result.shape == (3,) | ||
except AssertionError: | ||
raise AssertionError("Oh my god, you killed Euclid! You bas-turd!") |