Archived
This forum has been archived. Please start a new discussion on GitHub.
ValueError: invalid value for argument
Hi!
Recently I have decided to start writing tests in Python instead of C++, though my services are written in C++.
To cut it short: I do always get the "ValueError: invalid value for argument 1 in operation `AddUser'" exception when trying to run my test.
The faulting ( slice definition ) function is:
The faulting python code is:
I am suspecting myself in not clearly understanding how out parameters should be handled by python code.
Please, could you look into the files attached and provide a hint on what I do wrong.
----
With best regards,
Dmitry
Recently I have decided to start writing tests in Python instead of C++, though my services are written in C++.
To cut it short: I do always get the "ValueError: invalid value for argument 1 in operation `AddUser'" exception when trying to run my test.
The faulting ( slice definition ) function is:
int AddUser(User objUser, out long lUserId) ;
The faulting python code is:
nError, lPlayerUserId = secrt.AddUser(objUser)
I am suspecting myself in not clearly understanding how out parameters should be handled by python code.
Please, could you look into the files attached and provide a hint on what I do wrong.
----
With best regards,
Dmitry
0
Comments
-
Hi Dmitry,
This line is the problem:objUser = Secrt.User
This does not allocate an instance of Secrt.User, but actually assigns a reference to the Secrt.User class. Here is how you should be allocating the instance:objUser = Secrt.User()
Regards,
Mark0 -
Hi Dmitry,
This line is the problem:objUser = Secrt.User
This does not allocate an instance of Secrt.User, but actually assigns a reference to the Secrt.User class. Here is how you should be allocating the instance:objUser = Secrt.User()
Regards,
Mark
Yes, sir! That was the problem. Dumb me0