Пример #1
0
    def test_denied_users(self):
        denied_params = params.copy()
        denied_params['user'] = '******'
        try:
            pyrfc.Connection(**denied_params)
        except pyrfc.LogonError as ex:
            error = get_error(ex)

        assert error['code'] == 2
        assert error['key'] == 'RFC_LOGON_FAILURE'
        assert error['message'][0] == 'Name or password is incorrect (repeat logon)'
Пример #2
0
    def test_denied_users(self):
        denied_params = params.copy()
        denied_params["user"] = "******"
        try:
            pyrfc.Connection(**denied_params)
        except pyrfc.LogonError as ex:
            error = get_error(ex)

        assert error["code"] == 2
        assert error["key"] == "RFC_LOGON_FAILURE"
        assert error["message"][0] == "Name or password is incorrect (repeat logon)"
Пример #3
0
 def test_incomplete_params(self):
     incomplete_params = params.copy()
     for p in ['ashost', 'gwhost', 'mshost']:
         if p in incomplete_params:
             del incomplete_params[p]
     try:
         pyrfc.Connection(**incomplete_params)
     except pyrfc.RFCError as ex:
         error = get_error(ex)
     assert error['code'] == 20
     assert error['key'] == 'RFC_INVALID_PARAMETER'
     assert error['message'][0] in ['Parameter ASHOST, GWHOST, MSHOST or SERVER_PORT is missing.',
                  'Parameter ASHOST, GWHOST or MSHOST is missing.']
Пример #4
0
 def test_incomplete_params(self):
     incomplete_params = params.copy()
     for p in ["ashost", "gwhost", "mshost"]:
         if p in incomplete_params:
             del incomplete_params[p]
     try:
         pyrfc.Connection(**incomplete_params)
     except pyrfc.RFCError as ex:
         error = get_error(ex)
     assert error["code"] == 20
     assert error["key"] == "RFC_INVALID_PARAMETER"
     assert error["message"][0] in [
         "Parameter ASHOST, GWHOST, MSHOST or SERVER_PORT is missing.",
         "Parameter ASHOST, GWHOST or MSHOST is missing.",
     ]