Skip to content

Commit

Permalink
added missing time precision values (#784) (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
tholzheim authored Nov 13, 2024
1 parent 389a84d commit 992cedf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/test_wbi_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ def test_new_item_creation(self):
Time(time='+2021-01-00T00:00:00Z', before=1, after=2, precision=WikibaseTimePrecision.MONTH, timezone=4, prop_nr='P5'),
Time(time='+2021-00-00T00:00:00Z', before=1, after=2, precision=WikibaseTimePrecision.YEAR, timezone=4, prop_nr='P5'),
Time(time='+2021-00-00T00:00:00Z', before=1, after=2, precision=WikibaseTimePrecision.DECADE, timezone=4, prop_nr='P5'),
Time(time='-13700000000-00-00T00:00:00Z', before=0, after=0, precision=WikibaseTimePrecision.HUNDRED_MILLION_YEARS, timezone=0, prop_nr='P585'),
Time(time="-2450000000-00-00T00:00:00Z", before=0, after=0, precision=WikibaseTimePrecision.TEN_MILLION_YEARS, timezone=0, prop_nr='P585'),
Time(time="-40000-00-00T00:00:00Z", before=0, after=0, precision=WikibaseTimePrecision.TEN_THOUSAND_YEARS, timezone=0, prop_nr='P585'),
URL(value="http://www.wikidata.org", prop_nr='P6'),
URL(value="https://www.wikidata.org", prop_nr='P6'),
URL(value="ftp://example.com", prop_nr='P6'),
Expand Down
3 changes: 3 additions & 0 deletions wikibaseintegrator/wbi_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class WikibaseTimePrecision(Enum):
DECADE = 8
CENTURY = 7
MILLENNIUM = 6
TEN_THOUSAND_YEARS = 5
HUNDRED_THOUSAND_YEARS = 4
MILLION_YEARS = 3
TEN_MILLION_YEARS = 2
HUNDRED_MILLION_YEARS = 1
BILLION_YEARS = 0

0 comments on commit 992cedf

Please sign in to comment.