assert -> ValueError

This commit is contained in:
meejah 2020-06-13 00:41:22 -06:00 committed by Sajith Sasidharan
parent bd858f8fef
commit 66f61c514b
1 changed files with 2 additions and 1 deletions

View File

@ -155,7 +155,8 @@ class _FakeTahoeUriHandler(Resource, object):
cap = self._generate_capability(kind)
if self._data is None:
self._data = dict()
assert cap not in self._data, "already have '{}'".format(cap)
if cap in self._data:
raise ValueError("already have '{}'".format(cap))
self._data[cap] = data
return cap