예제 #1
0
 def testUrl(self):
     self.assertEqual(
         new_snippet("<arg1|url>",
                     ["arg1=^°!\"§$%&/()=?´`<>| ,.-;:_#+'*~"]),
         [
             "%5E%C2%B0%21%22%C2%A7%24%25%26/%28%29%3D%3F%C2%B4%60%3C%3E%7C%20%2C.-%3B%3A_%23%2B%27%2A%7E"
         ])
예제 #2
0
 def testSha512(self):
     self.assertEqual(
         new_snippet("<arg1|sha512>", ["arg1=abcdefghijklmnopqrstuvwxyz"]),
         [
             "4dbff86cc2ca1bae1e16468a05cb9881c97f1753bce"
             "3619034898faa1aabe429955a1bf8ec483d7421fe3c"
             "1646613a59ed5441fb0f321389f77f48a879c7b1f1"
         ])
예제 #3
0
 def testAddMixed(self):
     self.assertEqual(new_snippet("<arg1|add:'test'>", ["arg1=123"]), ["123test"])
     self.assertEqual(new_snippet("<arg1|add:'123'>", ["arg1=test"]), ["test123"])
예제 #4
0
 def testJoinRepeatable(self):
     self.assertEqual(new_snippet("<arg1...|join:','>", ["arg1=123", "arg1=456"]), ["123,456"])
예제 #5
0
 def testDate(self):
     self.assertEqual(
         new_snippet("<arg1|date:'%Y/%m/%d'>", ["arg1=1607038029"]),
         ["2020/12/04"])
예제 #6
0
 def testLength(self):
     self.assertEqual(new_snippet("<arg1|length>", ["arg1=test"]), ["4"])
     self.assertEqual(
         new_snippet("<arg1|length>", ["arg1=test", "arg1=tset"]),
         ["4", "4"])
예제 #7
0
 def testWordcount(self):
     self.assertEqual(
         new_snippet("<arg1|wordcount>", ["arg1=Good News Everyone!"]),
         ["3"])
예제 #8
0
파일: sha1.py 프로젝트: bytebutcher/snippet
 def testSha1(self):
     self.assertEqual(
         new_snippet("<arg1|sha1>", ["arg1=abcdefghijklmnopqrstuvwxyz"]),
         ["32d10c7b8cf96570ca04ce37f2a19d84240d3a89"])
예제 #9
0
 def testFirstRepeatable(self):
     self.assertEqual(
         new_snippet("<arg1...|first>", ["arg1=test", "arg1=abc"]),
         ["test"])
예제 #10
0
 def testTitleEmptyString(self):
     self.assertEqual(new_snippet("<arg1|title>", ["arg1="]), [""])
예제 #11
0
 def testCapfirstNoChar(self):
     self.assertEqual(new_snippet("<arg1|capfirst>", ["arg1=."]), ["."])
예제 #12
0
 def testSquote(self):
     self.assertEqual(new_snippet("<arg1|squote>", ["arg1=test"]),
                      ["'test'"])
예제 #13
0
 def testAddString(self):
     self.assertEqual(new_snippet("<arg1|add:'456'>", ["arg1=test"]), ["test456"])
예제 #14
0
 def testCenter(self):
     self.assertEqual(new_snippet("<arg1|center:'10'>", ["arg1=AB"]),
                      ["    AB    "])
예제 #15
0
 def testSafename(self):
     self.assertEqual(
         new_snippet("<arg1|safename>", ["arg1=some $string$"]),
         ["some__string_"])
예제 #16
0
 def testB64(self):
     self.assertEqual(new_snippet("<arg1|b64>", ["arg1=test"]), ["dGVzdA=="])
     self.assertEqual(new_snippet("<arg1|b64|b64>", ["arg1=test"]), ["ZEdWemRBPT0="])
예제 #17
0
 def testAddSlashes(self):
     self.assertEqual(
         new_snippet("<arg1|addslashes>", ["arg1=I'm using Snippet"]),
         ["I\\'m using Snippet"])
예제 #18
0
 def testSha256(self):
     self.assertEqual(
         new_snippet("<arg1|sha256>", ["arg1=abcdefghijklmnopqrstuvwxyz"]),
         [
             "71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73"
         ])
예제 #19
0
 def testTitle(self):
     self.assertEqual(new_snippet("<arg1|title>", ["arg1=hello, world!"]),
                      ["Hello, World!"])
예제 #20
0
 def testAddRepeatable(self):
     self.assertEqual(new_snippet("<arg1...|add:'abc'>", ["arg1=def", "arg1=cba"]), ["defabc cbaabc"])
     self.assertEqual(new_snippet("<arg1...|add:'123'>", ["arg1=321", "arg1=111"]), ["444 234"])
예제 #21
0
 def testCapfirst(self):
     self.assertEqual(new_snippet("<arg1|capfirst>", ["arg1=hello, world!"]), ["Hello, world!"])
예제 #22
0
 def testAddIntegers(self):
     self.assertEqual(new_snippet("<arg1|add:'12'>", ["arg1=21"]), ["33"])
예제 #23
0
 def testFirst(self):
     self.assertEqual(new_snippet("<arg1|first>", ["arg1=test"]), ["test"])
예제 #24
0
 def testTruncatechars(self):
     self.assertEqual(
         new_snippet("<arg1|truncatechars:'5'>", ["arg1=Hello, World!"]),
         ["Hello"])
예제 #25
0
 def testLengthRepeatable(self):
     self.assertEqual(
         new_snippet("<arg1...|length>", ["arg1=test", "arg1=abc"]), ["2"])
예제 #26
0
 def testRjust(self):
     self.assertEqual(new_snippet("<arg1|rjust:'5'>", ["arg1=AB"]),
                      ["   AB"])
예제 #27
0
파일: md5.py 프로젝트: R3N3G/snippet
 def testMd5(self):
     self.assertEqual(
         new_snippet("<arg1|md5>", ["arg1=abcdefghijklmnopqrstuvwxyz"]),
         ["c3fcd3d76192e4007dfb496cca67e13b"])
예제 #28
0
 def testTruncatewords(self):
     self.assertEqual(
         new_snippet("<arg1|truncatewords:'2'>",
                     ["arg1=Good News Everyone!"]), ["Good News"])
예제 #29
0
 def testDquote(self):
     self.assertEqual(new_snippet("<arg1|dquote>", ["arg1=test"]),
                      ["\"test\""])
예제 #30
0
 def testJoinNonRepeatable(self):
     self.assertEqual(new_snippet("<arg1|join:','>", ["arg1=123"]), ["123"])