예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 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)
예제 #7
0
 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)
예제 #8
0
 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)
예제 #9
0
 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)