Skip to content
Snippets Groups Projects
Commit e83899b1 authored by Niklas Stefan Nolte's avatar Niklas Stefan Nolte :fire:
Browse files

add type info to datahandle

parent 1788abd3
No related branches found
No related tags found
No related merge requests found
...@@ -145,6 +145,10 @@ class DataHandle(object): ...@@ -145,6 +145,10 @@ class DataHandle(object):
def force_location(self): def force_location(self):
return self._force_location return self._force_location
@property
def type(self):
return self._producer.type.getDefaultProperties()[self._key].type()
def __repr__(self): def __repr__(self):
return 'DataHandle({!r})'.format(self.location) return 'DataHandle({!r})'.format(self.location)
......
...@@ -40,6 +40,8 @@ def test_init(): ...@@ -40,6 +40,8 @@ def test_init():
producer2 = Algorithm(IntDataProducer) producer2 = Algorithm(IntDataProducer)
assert producer is producer2, "algorithms instantiation doesn't seem to be cached correctly" assert producer is producer2, "algorithms instantiation doesn't seem to be cached correctly"
assert producer2.OutputLocation.type == 'int'
with pytest.raises(ConfigurationError): with pytest.raises(ConfigurationError):
# same algorithms shouldn't have different names # same algorithms shouldn't have different names
Algorithm(IntDataProducer, name="wurst") Algorithm(IntDataProducer, name="wurst")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment