Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
philtweir committed Jul 10, 2023
1 parent 2edaa0a commit e07e555
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/target
/bonn/*.so
/python/bonn/*.so
__pycache__
*.egg-info
Dockerfile
Expand Down
14 changes: 12 additions & 2 deletions tests/category_manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
from nltk import download
from pathlib import Path
from fastapi.testclient import TestClient
from category_api.server import make_app
from unittest.mock import MagicMock
from bonn.extract import CategoryManager, FfModel
from category_api.healthcheck import Healthcheck
from dynaconf import Dynaconf

def get_test_data(datafile):
Expand Down Expand Up @@ -38,3 +36,15 @@ def settings():

def test_can_create_category_manager(category_manager):
pass

def test_can_add_categories(category_manager):
category_manager.add_categories_from_bow(
"cities",
{
"manchester": (("C", "manchester"),),
"cardiff": (("C", "cardiff"),),
"ealing": (("C", "ealing"),),
"underground": (("C", "underground"),),
}
)
print(category_manager.test("london", "cities"))

0 comments on commit e07e555

Please sign in to comment.