Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/common/test_utils.py
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
def test_parse_iso8601_date_to_utc_ko(invalid_iso8601_timestamp): | def test_parse_iso8601_date_to_utc_ko(invalid_iso8601_timestamp): | ||||
with pytest.raises(BadInputExc): | with pytest.raises(BadInputExc): | ||||
utils.parse_iso8601_date_to_utc(invalid_iso8601_timestamp) | utils.parse_iso8601_date_to_utc(invalid_iso8601_timestamp) | ||||
def test_format_utc_iso_date(): | def test_format_utc_iso_date(): | ||||
assert ( | assert ( | ||||
utils.format_utc_iso_date("2017-05-04T13:27:13+02:00") | utils.format_utc_iso_date("2017-05-04T13:27:13+02:00") | ||||
== "04 May 2017, 11:27 UTC" | == "04 May 2017, 11:27:13 UTC" | ||||
) | ) | ||||
def test_gen_path_info(): | def test_gen_path_info(): | ||||
input_path = "/home/user/swh-environment/swh-web/" | input_path = "/home/user/swh-environment/swh-web/" | ||||
expected_result = [ | expected_result = [ | ||||
{"name": "home", "path": "home"}, | {"name": "home", "path": "home"}, | ||||
{"name": "user", "path": "home/user"}, | {"name": "user", "path": "home/user"}, | ||||
▲ Show 20 Lines • Show All 294 Lines • Show Last 20 Lines |