Add test coverage for alphabetic sort

alphanumeric_key should sort filenames correctly when they differ in
text, not just numbers.
This commit is contained in:
Juan Nunez-Iglesias
2012-07-20 17:50:04 -05:00
parent 9006c1dab3
commit 699b5d9269
+4 -2
View File
@@ -24,9 +24,11 @@ class TestAlphanumericKey():
def setUp(self):
self.test_string = 'z23a'
self.test_str_result = ['z', 23, 'a']
self.filenames = ['f9.10.png', 'f9.9.png', 'f10.10.png', 'f10.9.png']
self.filenames = ['f9.10.png', 'f9.9.png', 'f10.10.png', 'f10.9.png',
'e9.png', 'e10.png', 'em.png']
self.sorted_filenames = \
['f9.9.png', 'f9.10.png', 'f10.9.png', 'f10.10.png']
['e9.png', 'e10.png', 'em.png', 'f9.9.png', 'f9.10.png',
'f10.9.png', 'f10.10.png']
def test_string_split(self):
assert_equal(alphanumeric_key(self.test_string), self.test_str_result)