Skip to content
Snippets Groups Projects
Commit e4fb052d authored by Jenkins for Software Heritage's avatar Jenkins for Software Heritage
Browse files

Update upstream source from tag 'debian/upstream/0.1.1'

Update to upstream version '0.1.1'
with Debian dir 8efde0d89250d5406f5e69344f46ff5813be3e6f
parents a5bfa5e3 d6c330af
No related branches found
No related tags found
No related merge requests found
Metadata-Version: 2.1
Name: swh.model
Version: 0.1.0
Version: 0.1.1
Summary: Software Heritage data model
Home-page: https://forge.softwareheritage.org/diffusion/DMOD/
Author: Software Heritage developers
......
Metadata-Version: 2.1
Name: swh.model
Version: 0.1.0
Version: 0.1.1
Summary: Software Heritage data model
Home-page: https://forge.softwareheritage.org/diffusion/DMOD/
Author: Software Heritage developers
......
......@@ -72,7 +72,17 @@ def sha1():
def aware_datetimes():
return datetimes(timezones=timezones())
# datetimes in Software Heritage are not used for software artifacts
# (which may be much older than 2000), but only for objects like scheduler
# task runs, and origin visits, which were created by Software Heritage,
# so at least in 2015.
# We're forbidding old datetimes, because until 1956, many timezones had seconds
# in their "UTC offsets" (see
# <https://en.wikipedia.org/wiki/Time_zone#Worldwide_time_zones>), which is not
# encodable in ISO8601; and we need our datetimes to be ISO8601-encodable in the
# RPC protocol
min_value = datetime.datetime(2000, 1, 1, 0, 0, 0)
return datetimes(min_value=min_value, timezones=timezones())
@composite
......
......@@ -6,10 +6,12 @@
import datetime
import attr
import iso8601
from hypothesis import given, settings
from swh.model.hashutil import DEFAULT_ALGORITHMS
from swh.model.hypothesis_strategies import (
aware_datetimes,
objects,
object_dicts,
contents,
......@@ -93,6 +95,14 @@ def test_dicts_generation(obj_type_and_obj):
assert branch is None or branch["target_type"] in target_types
@given(aware_datetimes())
def test_datetimes(dt):
# Checks this doesn't raise an error, eg. about seconds in the TZ offset
iso8601.parse_date(dt.isoformat())
assert dt.tzinfo is not None
@given(object_dicts(split_content=False))
def test_dicts_generation_merged_content(obj_type_and_obj):
# we should never generate a "skipped_content" here
......
v0.1.0-0-g9f5d266
\ No newline at end of file
v0.1.1-0-g091498e
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment