Example #1
0
File: testCLI.py Project: xmnr/atk
    def testConflictingArgumentsReturnsWithArgumentError(self):

        self.assertEqual(
            execute("--request", "--not-found")[1],
            cli.ARGUMENT_ERROR
        )
        self.assertEqual(
            execute("--response", "--post")[1],
            cli.ARGUMENT_ERROR
        )
Example #2
0
File: testCLI.py Project: xmnr/atk
    def testSettingVersion(self):

        self.assertEqual(
            execute("--request", "--version", "HTTP/2.1"),
            (request(version="HTTP/2.1"), cli.SUCCESS)
        )
        self.assertEqual(
            execute("--response", "--version", "HTTP/2.1"),
            (response(version="HTTP/2.1"), cli.SUCCESS)
        )
Example #3
0
File: testCLI.py Project: xmnr/atk
    def testSettingMethod(self):

        self.assertEqual(
            execute("--method", "PROPFIND"),
            (request(method="PROPFIND"), cli.SUCCESS)
        )
Example #4
0
File: testCLI.py Project: xmnr/atk
    def testSettingHeader(self):

        self.assertEqual(
            execute("--request", "-h", "User-agent", "fn"),
            (request(headers=(("User-agent", "fn"), )), cli.SUCCESS)
        )
Example #5
0
File: testCLI.py Project: xmnr/atk
    def testSettingReason(self):

        self.assertEqual(
            execute("--reason", "NOT OKAY"),
            (response(reason="NOT OKAY"), cli.SUCCESS)
        )
Example #6
0
File: testCLI.py Project: xmnr/atk
    def testSettingPath(self):

        self.assertEqual(
            execute("--path", "/login"),
            (request(path="/login"), cli.SUCCESS)
        )
Example #7
0
File: testCLI.py Project: xmnr/atk
    def testSettingStatus(self):

        self.assertEqual(
            execute("--status", "999"),
            (response(status="999"), cli.SUCCESS)
        )