Пример #1
0
 def test_enable(self):
     opt = get_options(["enable"])
     assert opt.command == "enable"
Пример #2
0
 def test_status(self):
     opt = get_options(["status"])
     assert opt.command == "status"
Пример #3
0
 def test_no_args(self):
     with pytest.raises(SystemExit):
         get_options(["credentials"])
Пример #4
0
 def test_disable(self):
     opt = get_options(["disable"])
     assert opt.command == "disable"
Пример #5
0
 def test_no_username(self):
     with pytest.raises(SystemExit):
         get_options(["credentials", "-pass-"])
Пример #6
0
 def test_ok_special(self):
     opt = get_options(["credentials", "--", "-user-", "-pass-"])
     assert opt.command == "credentials"
     assert opt.username == "-user-"
     assert opt.password == "-pass-"
Пример #7
0
 def test_ok_normal(self):
     opt = get_options(["credentials", "user", "pass"])
     assert opt.command == "credentials"
     assert opt.username == "user"
     assert opt.password == "pass"
Пример #8
0
 def test_with_argument(self):
     opt = get_options(["from-str", "some old string"])
     assert opt.command == "from-str"
     assert opt.string == "some old string"
Пример #9
0
def modified_get_options(string: str):
    return get_options(string.split())