Skip to content

Commit

Permalink
test: update bus removal test to include branch removal
Browse files Browse the repository at this point in the history
  • Loading branch information
danielolsen committed Oct 26, 2021
1 parent e11bcb6 commit e1d6f82
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion powersimdata/input/tests/test_change_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,18 @@ def test_remove_branch(ct):


def test_remove_bus(ct):
with pytest.raises(ValueError):
# Can't remove, because there are branches attached to it
ct.remove_bus({1})
ct.remove_branch({0, 1, 2})
ct.remove_bus({1})
with pytest.raises(ValueError):
# Can't remove again, because it shouldn't exist
ct.remove_bus({1})
# Evan after we remove the branch connected to bus 845...
ct.remove_branch({1094})
with pytest.raises(ValueError):
# Can't remove this bus, since there's a generator with non-zero capacity
# We can't remove this bus, since there's a generator with non-zero capacity
ct.remove_bus({845})
ct.scale_plant_capacity(resource="ng", plant_id={0: 0})
ct.remove_bus({845})

0 comments on commit e1d6f82

Please sign in to comment.