def test_get_dim_index_with_label(self): """ Test pyjstat get_dim_index() using label as parameter """ dim = self.oecd_datasets['oecd']['dimension']['id'][0] dims_df = pyjstat.get_dim_index(self.oecd_datasets['oecd'], dim) self.assertTrue(dims_df.iloc[0]['id'] == 'UNR') self.assertTrue(dims_df.iloc[-1]['index'] == 0)
def test_get_dim_index_with_label(self): """ Test pyjstat get_dim_index() using label as parameter """ dim = self.oecd_datasets["oecd"]["dimension"]["id"][0] dims_df = pyjstat.get_dim_index(self.oecd_datasets["oecd"], dim) self.assertTrue(dims_df.iloc[0]["id"] == "UNR") self.assertTrue(dims_df.iloc[-1]["index"] == 0)
def test_get_dim_index_with_index(self): """Test pyjstat get_dim_index() using id as parameter.""" dim = self.oecd_datasets['oecd']['dimension']['id'][2] dims_df = pyjstat.get_dim_index(self.oecd_datasets['oecd'], dim) self.assertTrue(dims_df.iloc[0]['id'] == '2003') self.assertTrue(dims_df.iloc[-1]['index'] == 11)