mirror of
https://github.com/macaodha/batdetect2.git
synced 2026-01-10 17:19:34 +01:00
18 lines
507 B
Python
18 lines
507 B
Python
import pytest
|
|
|
|
from batdetect2.targets import terms
|
|
from batdetect2.targets.terms import TagInfo
|
|
|
|
|
|
def test_tag_info_and_get_tag_from_info():
|
|
tag_info = TagInfo(value="Myotis myotis", key="event")
|
|
tag = terms.get_tag_from_info(tag_info)
|
|
assert tag.value == "Myotis myotis"
|
|
assert tag.term == terms.call_type
|
|
|
|
|
|
def test_get_tag_from_info_key_not_found():
|
|
tag_info = TagInfo(value="test", key="non_existent_key")
|
|
with pytest.raises(KeyError):
|
|
terms.get_tag_from_info(tag_info)
|