Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)