def test_all_terms_str(self): so_input = [{"options": {"type": "column"}, "terms": {"month": ["boston_temp", "new_york_temp"]}}] so_cleaned = { "boston_temp": {"_x_axis_term": "month", "type": "column"}, "new_york_temp": {"_x_axis_term": "month", "type": "column"}, } self.assertOptionDictsEqual(clean_cso(so_input, self.ds), so_cleaned)
def test_multiple_items_in_list(self): so_input = \ [{'options':{ 'type': 'column'}, 'terms': {'month':[ 'boston_temp', 'new_york_temp']} }, {'options': { 'type':'area'}, 'terms': {'month_seattle':[ 'seattle_temp']} }] so_cleaned = \ {'boston_temp': { '_x_axis_term': 'month', 'type': 'column'}, 'new_york_temp': { '_x_axis_term': 'month', 'type': 'column'}, 'seattle_temp':{ '_x_axis_term': 'month_seattle', 'type': 'area'}} self.assertOptionDictsEqual(clean_cso(so_input, self.ds), so_cleaned)
def test_multiple_items_in_list(self): so_input = [ {"options": {"type": "column"}, "terms": {"month": ["boston_temp", "new_york_temp"]}}, {"options": {"type": "area"}, "terms": {"month_seattle": ["seattle_temp"]}}, ] so_cleaned = { "boston_temp": {"_x_axis_term": "month", "type": "column"}, "new_york_temp": {"_x_axis_term": "month", "type": "column"}, "seattle_temp": {"_x_axis_term": "month_seattle", "type": "area"}, } self.assertOptionDictsEqual(clean_cso(so_input, self.ds), so_cleaned)
def test_all_terms_dict(self): so_input = [ { "options": {"type": "column"}, "terms": {"month": [{"boston_temp": {"type": "area", "xAxis": 1}}, {"new_york_temp": {"xAxis": 0}}]}, } ] so_cleaned = { "boston_temp": {"_x_axis_term": "month", "type": "area", "xAxis": 1}, "new_york_temp": {"_x_axis_term": "month", "type": "column", "xAxis": 0}, } self.assertOptionDictsEqual(clean_cso(so_input, self.ds), so_cleaned)
def test_all_terms_str(self): so_input = \ [{'options': { 'type': 'column'}, 'terms': { 'month':[ 'boston_temp', 'new_york_temp']} }] so_cleaned = \ {'boston_temp': { '_x_axis_term': 'month', 'type': 'column'}, 'new_york_temp': { '_x_axis_term': 'month', 'type': 'column'}} self.assertOptionDictsEqual(clean_cso(so_input, self.ds), so_cleaned)
def test_all_terms_dict(self): so_input = \ [{'options': {'type': 'column'}, 'terms': {'month':[ {'boston_temp': { 'type': 'area', 'xAxis': 1}}, {'new_york_temp': {'xAxis':0}}]} }] so_cleaned = \ {'boston_temp': { '_x_axis_term': 'month', 'type': 'area', 'xAxis': 1}, 'new_york_temp': { '_x_axis_term': 'month', 'type': 'column', 'xAxis': 0}} self.assertOptionDictsEqual(clean_cso(so_input, self.ds), so_cleaned)