!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.16 (Debian). PHP/5.3.3-7+squeeze19 

uname -a: Linux mail.tri-specialutilitydistrict.com 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC
2014 x86_64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/pyshared/twisted/test/   drwxr-xr-x
Free 130.03 GB of 142.11 GB (91.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_formmethod.py (3 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.


"""
Test cases for formmethod module.
"""

from twisted.trial import unittest

from twisted.python import formmethod


class ArgumentTestCase(unittest.TestCase):

    def argTest(self, argKlass, testPairs, badValues, *args, **kwargs):
        arg = argKlass("name", *args, **kwargs)
        for val, result in testPairs:
            self.assertEquals(arg.coerce(val), result)
        for val in badValues:
            self.assertRaises(formmethod.InputError, arg.coerce, val)
    
    def testString(self):
        self.argTest(formmethod.String, [("a", "a"), (1, "1"), ("", "")], ())
        self.argTest(formmethod.String, [("ab", "ab"), ("abc", "abc")], ("2", ""), min=2)
        self.argTest(formmethod.String, [("ab", "ab"), ("a", "a")], ("223213", "345x"), max=3)
        self.argTest(formmethod.String, [("ab", "ab"), ("add", "add")], ("223213", "x"), min=2, max=3)
    
    def testInt(self):
        self.argTest(formmethod.Integer, [("3", 3), ("-2", -2), ("", None)], ("q", "2.3"))
        self.argTest(formmethod.Integer, [("3", 3), ("-2", -2)], ("q", "2.3", ""), allowNone=0)

    def testFloat(self):
        self.argTest(formmethod.Float, [("3", 3.0), ("-2.3", -2.3), ("", None)], ("q", "2.3z"))
        self.argTest(formmethod.Float, [("3", 3.0), ("-2.3", -2.3)], ("q", "2.3z", ""),
                     allowNone=0)

    def testChoice(self):
        choices = [("a", "apple", "an apple"),
                   ("b", "banana", "ook")]
        self.argTest(formmethod.Choice, [("a", "apple"), ("b", "banana")],
                     ("c", 1), choices=choices)

    def testFlags(self):
        flags =  [("a", "apple", "an apple"),
                  ("b", "banana", "ook")]
        self.argTest(formmethod.Flags,
                     [(["a"], ["apple"]), (["b", "a"], ["banana", "apple"])],
                     (["a", "c"], ["fdfs"]),
                     flags=flags)

    def testBoolean(self):
        tests =  [("yes", 1), ("", 0), ("False", 0), ("no", 0)]
        self.argTest(formmethod.Boolean, tests, ())

    def testDate(self):
        goodTests = { 
            ("2002", "12", "21"): (2002, 12, 21),
            ("1996", "2", "29"): (1996, 2, 29),
            ("", "", ""): None,
            }.items()
        badTests = [("2002", "2", "29"), ("xx", "2", "3"),
                    ("2002", "13", "1"), ("1999", "12","32"),
                    ("2002", "1"), ("2002", "2", "3", "4")]
        self.argTest(formmethod.Date, goodTests, badTests)

    def testRangedInteger(self):
        goodTests = {"0": 0, "12": 12, "3": 3}.items()
        badTests = ["-1", "x", "13", "-2000", "3.4"]
        self.argTest(formmethod.IntegerRange, goodTests, badTests, 0, 12)

    def testVerifiedPassword(self):
        goodTests = {("foo", "foo"): "foo", ("ab", "ab"): "ab"}.items()
        badTests = [("ab", "a"), ("12345", "12345"), ("", ""), ("a", "a"), ("a",), ("a", "a", "a")]
        self.argTest(formmethod.VerifiedPassword, goodTests, badTests, min=2, max=4)

        

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0223 ]--