def test_parse_object_type():
assert parse_object_type("content") == ObjectType.CONTENT
assert parse_object_type("directory") == ObjectType.DIRECTORY
assert parse_object_type("revision") == ObjectType.REVISION
assert parse_object_type("release") == ObjectType.RELEASE
assert parse_object_type("snapshot") == ObjectType.SNAPSHOT
with pytest.raises(BadInputExc) as e:
parse_object_type("foo")
> assert e.match("Invalid object")
E AssertionError: Regex pattern 'Invalid object' does not match 'Invalid swh object type! Valid types are snapshot, revision, release, directory, content; not foo'.
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_identifiers.py:73: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Mar 3 2021, 10:02 AM