Currently, we're not correctly handling the cases where the input string is None
from univers.version_range import VersionRange
>>> VersionRange.from_string(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "../univers/src/univers/version_range.py", line 102, in from_string
vers = remove_spaces(vers)
File "../univers/src/univers/utils.py", line 9, in remove_spaces
return "".join(string.split())
AttributeError: 'NoneType' object has no attribute 'split'
We should raise ValueError similar to what we do with empty string.
from univers.version_range import VersionRange
>>> VersionRange.from_string("")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "../univers/src/univers/version_range.py", line 115, in from_string
raise ValueError(f"{vers!r} must start with the 'vers:' URI scheme.")
ValueError: '' must start with the 'vers:' URI scheme.
Currently, we're not correctly handling the cases where the input string is
NoneWe should raise
ValueErrorsimilar to what we do with empty string.