Beispiel #1
0
 def test_clean(self):
     self.assertEquals(clean_path(''), '')
     self.assertEquals(clean_path('.'), '')
     self.assertEquals(clean_path('..'), '')
     self.assertEquals(clean_path('/'), '')
     self.assertEquals(clean_path('/foo'), 'foo')
     self.assertEquals(clean_path('/foo/'), 'foo')
     self.assertEquals(clean_path('/foo/bar'), 'foo/bar')
     self.assertEquals(clean_path('/foo/bar/'), 'foo/bar')
Beispiel #2
0
 def test_clean(self):
     self.assertEquals(clean_path(''), '')
     self.assertEquals(clean_path('.'), '')
     self.assertEquals(clean_path('..'), '')
     self.assertEquals(clean_path('/'), '')
     self.assertEquals(clean_path('/foo'), 'foo')
     self.assertEquals(clean_path('/foo/'), 'foo')
     self.assertEquals(clean_path('/foo/bar'), 'foo/bar')
     self.assertEquals(clean_path('/foo/bar/'), 'foo/bar')
Beispiel #3
0
 def test_clean_bad(self):
     with self.assertRaises(ValueError):
         clean_path('\\')
     with self.assertRaises(ValueError):
         clean_path('\\foo')
Beispiel #4
0
 def test_clean_bad(self):
     with self.assertRaises(ValueError):
         clean_path('\\')
     with self.assertRaises(ValueError):
         clean_path('\\foo')