Example #1
0
 def test_same(self):
     original = '/home/user/test.txt'
     new = '/home/user/test.txt'
     distance = SOM.path_distance(original, new)
     self.assertEqual(distance, 0)
Example #2
0
 def test_across_root(self):
     new = '/home/user/firefox/bookmarks'
     original = '/var/log/gnome'
     distance = SOM.path_distance(original, new)
     self.assertEqual(distance, 7)
Example #3
0
 def test_down_file(self):
     new = '/home/user/doc.pdf'
     original = '/home/user'
     distance = SOM.path_distance(original, new)
     self.assertEqual(distance, 1)
Example #4
0
 def test_down_folder(self):
     new = '/home/user/typography/doc.pdf'
     original = '/home/user'
     distance = SOM.path_distance(original, new)
     self.assertEqual(distance, 2)
Example #5
0
 def test_up_different(self):
     original = '/home/user/typography/doc.pdf'
     new = '/home/user/test.txt'
     distance = SOM.path_distance(original, new)
     self.assertEqual(distance, 3)
Example #6
0
 def test_up_prefix(self):
     original = '/home/user/typography/doc.pdf'
     new = '/home/user'
     distance = SOM.path_distance(original, new)
     self.assertEqual(distance, 2)