Skip to content

Commit

Permalink
Update test_new_scen
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Feb 27, 2020
1 parent 5b19ffc commit cf37feb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ def test_new_scen(test_mp):
scen = ixmp.Scenario(test_mp, *can_args, version='new')
assert scen.version == 0

# Create a Scenario with scheme='MESSAGE'
scen2 = ixmp.Scenario(test_mp, model='foo', scenario='bar',
scheme='MESSAGE', version='new')
# A scenario with scheme='MESSAGE' can only be created with a subclass
class Scenario(ixmp.Scenario):
pass

scen2 = Scenario(test_mp, model='foo', scenario='bar',
scheme='MESSAGE', version='new')

# JDBCBackend complains unless these items are added
scen2.add_set('technology', 't')
scen2.add_set('year', '2000')
Expand All @@ -54,9 +58,7 @@ def test_new_scen(test_mp):
with pytest.raises(RuntimeError):
ixmp.Scenario(test_mp, model='foo', scenario='bar')

# …but loading with any subclass of ixmp.Scenario is fine
class Scenario(ixmp.Scenario):
pass
# …but loading with a subclass of ixmp.Scenario is fine
Scenario(test_mp, model='foo', scenario='bar')


Expand Down

0 comments on commit cf37feb

Please sign in to comment.