Skip to content

Commit

Permalink
added test for correct shape when extracting
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinstadler committed Apr 9, 2024
1 parent b9959c3 commit cc968fe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,19 @@ def test_extract(fix_testmrio):
assert "F" in with_missing.keys()
assert "FOO" not in with_missing.keys()

# Test for correct shape when extracting one row
assert tt.factor_inputs.extract("Value Added", return_type="ext").F.index == tt.factor_inputs.get_rows()
assert tt.factor_inputs.extract(("Value Added"), return_type="ext").F.index == tt.factor_inputs.get_rows()
assert tt.factor_inputs.extract(["Value Added"], return_type="ext").F.index == tt.factor_inputs.get_rows()

assert tt.factor_inputs.extract(tt.factor_inputs.get_rows(), return_type="ext").F.index == tt.factor_inputs.get_rows()
pdt.assert_index_equal(tt.emissions.extract(tt.emissions.get_rows(), return_type="ext").F.index, tt.emissions.get_rows())
assert tt.emissions.extract(tt.emissions.get_rows()[0], return_type="ext").F.index == tt.emissions.get_rows()[0]






def test_extension_extract(fix_testmrio):
tt = fix_testmrio.testmrio
Expand Down Expand Up @@ -343,6 +356,7 @@ def test_extension_extract(fix_testmrio):
assert all(dfm.get_sectors() == tt.get_sectors())



def test_diag_stressor(fix_testmrio):
stressor_name = ("emission_type1", "air")
stressor_number = 0
Expand Down

0 comments on commit cc968fe

Please sign in to comment.