fixes in datatypes

- Enum.__call__(self, value) should raise BadValueError when
  value is not hashable
- added TextType.copy (DataType.copy will not work here)

Change-Id: I6c460991fa1e6595a939fb0814f490d2188c97b4
Reviewed-on: https://forge.frm2.tum.de/review/21015
Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2019-08-15 15:42:43 +02:00
parent cd1b4cf4e2
commit 74eb33b789
2 changed files with 6 additions and 2 deletions

View File

@ -174,7 +174,7 @@ def test_EnumType():
dt(-9)
with pytest.raises(ValueError):
dt(u'XX')
with pytest.raises(TypeError):
with pytest.raises(ValueError):
dt([19, u'X'])
assert dt(u'a') == 3