Skip to content

Commit

Permalink
add AMPS (#585)
Browse files Browse the repository at this point in the history
* add AMPS

* fix issues

* re-formatting
  • Loading branch information
zsomborfoldi authored Nov 29, 2024
1 parent f0339d5 commit 86d160a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions ebl/common/domain/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
class ResearchProject(NamedEnumWithParent):
CAIC = ("Cuneiform Artefacts of Iraq in Context", "CAIC", None)
ALU_GENEVA = ("Edition of the Omen Series Summa Alu", "aluGeneva", None)
AMPS = ("Ancient Mesopotamian Priestly Scholasticism", "AMPS", None)
2 changes: 1 addition & 1 deletion ebl/tests/factories/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class Meta:
introduction = Introduction("text", (StringPart("text"),))
notes = Notes("notes", (StringPart("notes"),))
external_numbers = factory.SubFactory(ExternalNumbersFactory)
projects = (ResearchProject.CAIC,)
projects = (ResearchProject.CAIC, ResearchProject.ALU_GENEVA, ResearchProject.AMPS)
archaeology = factory.SubFactory(ArchaeologyFactory)
colophon = factory.SubFactory(ColophonFactory)

Expand Down
6 changes: 5 additions & 1 deletion ebl/tests/fragmentarium/test_dtos.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def expected_dto(lemmatized_fragment, has_photo):
"externalNumbers": ExternalNumbersSchema().dump(
lemmatized_fragment.external_numbers
),
"projects": [ResearchProject["CAIC"].abbreviation],
"projects": [
ResearchProject["CAIC"].abbreviation,
ResearchProject["ALU_GENEVA"].abbreviation,
ResearchProject["AMPS"].abbreviation,
],
"archaeology": ArchaeologySchema().dump(lemmatized_fragment.archaeology),
"colophon": ColophonSchema().dump(lemmatized_fragment.colophon),
"authorizedScopes": [],
Expand Down
5 changes: 3 additions & 2 deletions ebl/tests/fragmentarium/test_fragment_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,11 +1084,12 @@ def test_query_genres(fragment_repository, query, expected):
[
("CAIC", [0]),
("aluGeneva", [1]),
(None, [0, 1]),
("AMPS", [2]),
(None, [0, 1, 2]),
],
)
def test_query_project(fragment_repository, query, expected):
projects = [ResearchProject.CAIC, ResearchProject.ALU_GENEVA]
projects = [ResearchProject.CAIC, ResearchProject.ALU_GENEVA, ResearchProject.AMPS]

fragments = [
FragmentFactory.build(
Expand Down
2 changes: 1 addition & 1 deletion ebl/tests/fragmentarium/test_fragments_search_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def test_search_script_period(client, fragmentarium, params, expected):

@pytest.mark.parametrize(
"project",
[ResearchProject.CAIC, ResearchProject.ALU_GENEVA],
[ResearchProject.CAIC, ResearchProject.ALU_GENEVA, ResearchProject.AMPS],
)
def test_search_project(client, fragmentarium, project):
fragments = [
Expand Down

0 comments on commit 86d160a

Please sign in to comment.