Skip to content

Commit

Permalink
Updated make_unique_path utility unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 11, 2017
1 parent 7868686 commit a56611c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,30 @@ def test_get_path_from_item_with_custom_group_and_matching_label(self):

def test_make_path_unique_no_clash(self):
path = ('Element', 'A')
new_path = make_path_unique(path, {})
new_path = make_path_unique(path, {}, True)
self.assertEqual(new_path, path)

def test_make_path_unique_clash_without_label(self):
path = ('Element',)
new_path = make_path_unique(path, {path: 1})
new_path = make_path_unique(path, {path: 1}, True)
self.assertEqual(new_path, path+('I',))

def test_make_path_unique_clash_with_label(self):
path = ('Element', 'A')
new_path = make_path_unique(path, {path: 1})
new_path = make_path_unique(path, {path: 1}, True)
self.assertEqual(new_path, path+('I',))

def test_make_path_unique_no_clash_old(self):
path = ('Element', 'A')
new_path = make_path_unique(path, {}, False)
self.assertEqual(new_path, path)

def test_make_path_unique_clash_without_label_old(self):
path = ('Element',)
new_path = make_path_unique(path, {path: 1}, False)
self.assertEqual(new_path, path+('I',))

def test_make_path_unique_clash_with_label_old(self):
path = ('Element', 'A')
new_path = make_path_unique(path, {path: 1}, False)
self.assertEqual(new_path, path[:-1]+('I',))

0 comments on commit a56611c

Please sign in to comment.