예제 #1
0
 def testCleanStringsUntouched(self):
     clean = u'this/is-1234/a_clean_string'
     self.assertEqual(clean, escape(clean))
예제 #2
0
 def testNoMultipleSlashes(self):
     for s in STRINGS:
         self.assertNotIn('//', escape(s))
예제 #3
0
 def testNoTrailingSlashes(self):
     for s in STRINGS:
         self.assertNotEqual('/', escape(s)[-1])
예제 #4
0
 def testNoLeadingSlashes(self):
     for s in STRINGS:
         self.assertNotEqual('/', escape(s)[0])
예제 #5
0
 def testCleanOutput(self):
     for s in STRINGS:
         self.assertNotRegexpMatches(escape(s), r'[^\w\-\~/]')
예제 #6
0
 def testRoundTripEquivalent(self):
     for s in STRINGS:
         self.assertEqual(s, unescape(escape(s)))