def test_flows(self): key = object() ensys = es.EnergySystem(groupings=[Flows(key)]) Node.registry = ensys flows = (object(), object()) bus = NewBus(label="A Bus") Node(label="A Node", inputs={bus: flows[0]}, outputs={bus: flows[1]}) eq_(ensys.groups[key], set(flows))
def test_flows_with_nodes(self): key = object() ensys = es.EnergySystem(groupings=[FWNs(key)]) Node.registry = ensys flows = (object(), object()) bus = NewBus(label="A Bus") node = Node(label="A Node", inputs={bus: flows[0]}, outputs={bus: flows[1]}) eq_(ensys.groups[key], {(bus, node, flows[0]), (node, bus, flows[1])})
def test_Flows(self): key = object() ES = es.EnergySystem(groupings=[Flows(key)]) flows = (object(), object()) bus = NewBus(label="A Bus") node = Node(label="A Node", inputs={bus: flows[0]}, outputs={bus: flows[1]}) eq_(ES.groups[key], set(flows))
def test_FlowsWithNodes(self): key = object() ES = es.EnergySystem(groupings=[FWNs(key)]) Node.registry = ES flows = (object(), object()) bus = NewBus(label="A Bus") node = Node(label="A Node", inputs={bus: flows[0]}, outputs={bus: flows[1]}) eq_(ES.groups[key], set( ((bus, node, flows[0]), (node, bus, flows[1]))))