Beispiel #1
0
 def test_validate_range_expression(self):
     test_map = {
         1: {
             "name": "China",
             "missing": False,
             "combined_ids": range(1, 5)
         }
     }
     modified_map = validate_category_map(test_map)
     assert modified_map[0]['combined_ids'] == [1, 2, 3, 4]
Beispiel #2
0
 def test_validate_range_expression(self):
     test_map = {
         1: {
             "name": "China",
             "missing": False,
             "combined_ids": range(1, 5)
         }
     }
     modified_map = validate_category_map(test_map)
     assert modified_map[0]['combined_ids'] == [1, 2, 3, 4]
Beispiel #3
0
 def test_validate_category_map(self):
     """ Validate we are properly converting the given map of categories """
     expected_map = [{
         "id": 1,
         "name": "China",
         "missing": False,
         "combined_ids": [2, 3]
     }, {
         "id": 2,
         "name": "Other",
         "missing": False,
         "combined_ids": [1]
     }]
     modified_map = validate_category_map(CATEGORY_MAP)
     assert modified_map == expected_map
Beispiel #4
0
 def test_validate_category_map(self):
     """ Validate we are properly converting the given map of categories """
     expected_map = [
         {
             "id": 1,
             "name": "China",
             "missing": False,
             "combined_ids": [2, 3]
         },
         {
             "id": 2,
             "name": "Other",
             "missing": False,
             "combined_ids": [1]
         }
     ]
     modified_map = validate_category_map(CATEGORY_MAP)
     assert modified_map == expected_map