Пример #1
0
 def test_basic_path(self):
     kw = get_keywords_from_path(
         u"~/Ubuntu One/is/the path/path! for/my%$files/here.txt")
     # result should not include base directory and should be sorted
     self.assertEqual(
         list(sorted(kw)),
         sorted(['files', 'for', 'is', 'here', 'path', 'the', 'txt', 'my']))
Пример #2
0
 def test_documents_path(self):
     kw = get_keywords_from_path(
         u"~/Documents/is/the path/path! for/my%$files/here.txt")
     # result should include documents and should be sorted
     self.assertEqual(
         sorted(kw),
         sorted(['documents', 'files', 'for', 'is', 'here', 'path', 'the',
                 'txt', 'my']))
Пример #3
0
 def test_normalized_path(self):
     kw = get_keywords_from_path(
         u"~/Do\u0304cuments/is/the path/path!"
         u" fo\u0304r/my%$files/hero\u0304.txt")
     # unicode character should be normalized
     self.assertEqual(
         sorted(kw),
         sorted(['documents', 'files', 'for', 'is', 'hero', 'path', 'the',
                 'txt', 'my']))