- for locator_set_type, item in locator_set1.iteritems():
- if locator_set_type == 'normal':
- self.lisp_should_be_equal(item, locator_set2)
- elif locator_set_type == 'reset':
- for locator_list in reversed(item):
- name = locator_list.get('locator-set')
- if name not in locator_set_list:
- reset_list.insert(0, locator_list)
- locator_set_list.append(name)
- self.lisp_should_be_equal(reset_list, locator_set2)
- else:
- raise ValueError('Unknown locator_set_type value: '
- '{}'.format(locator_set_type))
+ tmp_list = list(locator_set1)
+ while len(tmp_list):
+ locator_set = tmp_list.pop(0)
+ locator_set_name = locator_set.get('locator-set')
+ for tmp_loc_set in tmp_list:
+ tmp_loc_set_name = tmp_loc_set.get('locator-set')
+ if locator_set_name == tmp_loc_set_name:
+ locator_set = tmp_loc_set
+ tmp_list.remove(tmp_loc_set)
+ locator_set_list.append(locator_set)
+
+ for locator_set in locator_set2:
+ if 'locator-set-index' in locator_set:
+ del locator_set['locator-set-index']
+
+ self.lisp_should_be_equal(locator_set_list, locator_set2)