Beispiel #1
0
    def test_serial_list_port(self):

        args = cli.get_args(["serial", "--list-port"])

        self.assertTrue(args["list_port"])

        args = cli.get_args(["serial"])

        self.assertFalse(args["list_port"])
Beispiel #2
0
    def test_serial_password(self):

        password = "******"

        args = cli.get_args(["serial", "--password", password])
        self.assertEqual(args["password"], password)

        args = cli.get_args(["serial", "-p", password])
        self.assertEqual(args["password"], password)
Beispiel #3
0
    def test_serial_secret(self):

        secret = "class"

        args = cli.get_args(["serial", "--secret", secret])
        self.assertEqual(args["secret"], secret)

        args = cli.get_args(["serial", "-s", secret])
        self.assertEqual(args["secret"], secret)
Beispiel #4
0
    def test_serial_username(self):

        username = "******"

        args = cli.get_args(["serial", "--username", username])
        self.assertEqual(args["username"], username)

        args = cli.get_args(["serial", "-l", username])
        self.assertEqual(args["username"], username)
Beispiel #5
0
    def test_serial_auth(self):

        username = "******"
        password = "******"
        secret = "class"

        args = cli.get_args([
            "serial", "--username", username, "--password", password,
            "--secret", secret
        ])

        self.assertEqual(args["username"], username)
        self.assertEqual(args["password"], password)
        self.assertEqual(args["secret"], secret)

        args = cli.get_args(
            ["serial", "-l", username, "-p", password, "-s", secret])

        self.assertEqual(args["username"], username)
        self.assertEqual(args["password"], password)
        self.assertEqual(args["secret"], secret)