Beispiel #1
0
 def test_get_common_prefix_5(self):
     self.assertEquals(None, StringTools.get_common_prefix(()))
Beispiel #2
0
 def test_get_common_prefix_6(self):
     self.assertEquals((1, 2, 3), StringTools.get_common_prefix(((1,2,3),(1,2,3,4))))
Beispiel #3
0
 def test_get_common_prefix_4(self):
     self.assertEquals('', StringTools.get_common_prefix(('A', 'B')))
Beispiel #4
0
 def test_get_common_prefix_3(self):
     self.assertEquals('', StringTools.get_common_prefix(('dyn', 'prio4dyn', 'prid4dyn')))
Beispiel #5
0
 def test_get_common_prefix_2(self):
     self.assertEquals('', StringTools.get_common_prefix(set(('ABC', 'ABCD', 'ABCE', 'XYZ'))))
Beispiel #6
0
 def test_get_common_prefix_1(self):
     self.assertEquals('ABC', StringTools.get_common_prefix(iter(('ABC', 'ABCD', 'ABCE'))))
Beispiel #7
0
 def common_base_directory(cls, file_paths, pathmodule=os.path):
     return StringTools.get_common_prefix(
         imap(os.path.normpath, imap(pathmodule.dirname, file_paths)))