Ejemplo n.º 1
0
 def test_get_missing_options(self):
     for cmdline in ("unittest get --file foo", "unittest get --file foo --email foo@bar"):
         print cmdline
         options = pwsafecli.parse_commandline(self.parsers,
                                              cmdline.split())
         with AssertRaises(pwsafecli.PWSafeCLIValidationError):
             pwsafecli.get_validator(options)
Ejemplo n.º 2
0
 def test_get_missing_options(self):
     for cmdline in ("unittest get --file foo",
                     "unittest get --file foo --email foo@bar"):
         print(cmdline)
         options = pwsafecli.parse_commandline(self.parsers,
                                               cmdline.split())
         with AssertRaises(pwsafecli.PWSafeCLIValidationError):
             pwsafecli.get_validator(options)
Ejemplo n.º 3
0
    def test_get_display_option(self):
        options = pwsafecli.parse_commandline(self.parsers, "unittest get --file foo --uuid f2dee5f8-e964-402f-9fe7-78bd2b5cba2e --display username,password".split())
        pwsafecli.get_validator(options)

        options = pwsafecli.parse_commandline(self.parsers, "unittest get --file foo --uuid f2dee5f8-e964-402f-9fe7-78bd2b5cba2e --display username,password,uuid".split())
        pwsafecli.get_validator(options)

        options = pwsafecli.parse_commandline(self.parsers, "unittest get --file foo --uuid f2dee5f8-e964-402f-9fe7-78bd2b5cba2e --display username,password,uuid,missing".split())

        with AssertRaises(pwsafecli.PWSafeCLIValidationError) as cm:
            pwsafecli.get_validator(options)
Ejemplo n.º 4
0
    def test_get_display_option(self):
        options = pwsafecli.parse_commandline(
            self.parsers,
            "unittest get --file foo --uuid f2dee5f8-e964-402f-9fe7-78bd2b5cba2e --display username,password"
            .split())
        pwsafecli.get_validator(options)

        options = pwsafecli.parse_commandline(
            self.parsers,
            "unittest get --file foo --uuid f2dee5f8-e964-402f-9fe7-78bd2b5cba2e --display username,password,uuid"
            .split())
        pwsafecli.get_validator(options)

        options = pwsafecli.parse_commandline(
            self.parsers,
            "unittest get --file foo --uuid f2dee5f8-e964-402f-9fe7-78bd2b5cba2e --display username,password,uuid,missing"
            .split())

        with AssertRaises(pwsafecli.PWSafeCLIValidationError) as cm:
            pwsafecli.get_validator(options)