def test_fill_missing_regions_from_world(): vals = { 'World': 2, 'OECD90': 1, 'Eastern Europe': nan, 'Asia (Sans Japan)': 3, 'Middle East and Africa': 4, 'Latin America': 5, 'China': 0, 'India': nan, 'EU': 0, 'USA': 0 } data = pd.Series(data=vals, name='regional values') exp_vals = { 'World': 2, 'OECD90': 1, 'Eastern Europe': 2, 'Asia (Sans Japan)': 3, 'Middle East and Africa': 4, 'Latin America': 5, 'China': 0, 'India': nan, 'EU': 0, 'USA': 0 } expected = pd.Series(data=exp_vals, name='regional values') pd.testing.assert_series_equal(expected, fill_missing_regions_from_world(data))
def test_fill_missing_regions_from_world_passthru(): assert fill_missing_regions_from_world(1) == 1