Commit Graph

24 Commits

Author SHA1 Message Date
Martin Molinero 886e5e6445 Test fixes and updates 2020-04-23 09:59:31 -03:00
Leonardo-Ferreira 951c973d5b Adjusted the OneTimeSetup attribute usage 2020-04-22 18:19:08 -03:00
Leonardo-Ferreira 37b1906022 Updated to OneTimeSetUp 2020-04-22 18:16:58 -03:00
Michael Handschuh 35dcec2dc4 Update Tests to respect CA1304 and CA1305
Updates all occurrences of parsing/ToString-ing to go through the new
StringExtensions methods that use CultureInfo.InvariantCulture

See #3045
2019-09-12 15:30:46 -04:00
Martin Molinero d9195317e3 C# decimal to Python conversion
- This commit is related to PR 19 in QC/pythonnet
   - C# decimal will be cast to C# double and converted into python
   float
- Adding new `decimal.py` into the python algorithm project. This is
required for backwards compatibility with users performing operations
over expected decimal types (like `Price`)
- Updating two python regression test algorithms using custom python
execution models to be aware and ignore floating point precision errors
when handling order sizing.
2019-01-15 12:13:42 -03:00
Stefano Raggi fadda32e08 Enable ignored/excluded Python unit tests 2018-08-09 11:51:53 +02:00
AlexCatarino 58603b1035 Fix method call name in python script 2018-08-07 19:31:22 +01:00
AlexCatarino cc1c643a78 Fixes NoMethodMatchPythonExceptionInterpreterTests
Changes the method call that should fail to `AddCash(String)`.
2018-08-07 19:22:41 +01:00
AlexCatarino 331438d2df Improves Tests for PythonException interpreters
Adds a test to verify whether the message contains the stacktrace information
2018-03-12 22:35:27 +00:00
AlexCatarino 30263b2a51 Implements catch-all Python Exception Interpreter
Implements `PythonExceptionInterpreter` that works as a "catch-all" exception intrepreter for `PythonException`. Since it can interpret more specific python exceptions that are already covered by other interpreters, its `Order` is set to `int.MaxValue` to be the last to be tested.
2018-03-12 22:32:26 +00:00
AlexCatarino 980411b918 Adds IExceptionInterpreter.Order property
The Order property can be used to give priority on exception interpreters calls.
2018-03-08 17:25:30 +00:00
AlexCatarino bd9766d4f4 Implements UnsupportedOperandPythonExceptionInterpreter
Users often try to make operations between decimal (prices from securitties) and float.
2018-03-06 13:04:29 +00:00
AlexCatarino 7fc8886803 Implements NoMethodMatchPythonExceptionInterpreter
Users often use the wrong type of method paramenters, for instance, a float instead of an integer.
2018-03-06 12:10:16 +00:00
AlexCatarino b672580693 Implements KeyErrorPythonExceptionInterpreter 2018-03-06 11:05:39 +00:00
AlexCatarino cd1d45ccf0 Minor fixes
Use interpreter.GetMessageHeader(e) instead of e.Message to produce to collated exception message containing the messages from inner exceptions.
Add the DllNotFoundPythonExceptionInterpreterTests to the test project.
2018-03-06 11:02:13 +00:00
AlexCatarino 27198eda7a Implements InvalidTokenPythonExceptionInterpreter
This exception interpreter interprets a SyntaxError due to invalid token in python scripts
2018-03-05 22:55:11 +00:00
AlexCatarino 718c1d61c8 Implements DllNotFoundPythonExceptionInterpreter
This exception interpreter interprets a DllNotFoundException that is thrown when pythonnet cannot fing the python dynamic-link library in the system.
2018-03-05 22:55:11 +00:00
Michael Handschuh 6c151993ea Format errors w/ header line and detail on following lines
We format the message before being set to the result handler's log message
method so it ends up being outputted as we wish. The desired output is a
header line with the collated message from the exception (including inners)
followed by the full exception detail (inner stack traces and all).
2018-03-02 16:16:46 -05:00
Michael Handschuh d74a80448a Remove duplicat message from sched event interpreter
Also fixes test type name from recent name change projection -> interpreter
2018-03-02 15:26:40 -05:00
Michael Handschuh fa1ea521b1 Catch stragglers from recent rename, projection -> interpreter 2018-03-01 12:36:00 -05:00
Michael Handschuh 5623659098 Add StackExceptionInterpreter.ToString and null interpreter for tests 2018-03-01 12:36:00 -05:00
Michael Handschuh 148ae5986a Rename projections -> interpreters 2018-03-01 12:36:00 -05:00
Michael Handschuh 985d53a662 Implement recursive exception projections
Often times exceptions are wrapped in other exceptions that are potentially
wrapped in other exceptions (ad. infinum) -- this lends itself to a recursive
strategy for projecting exception instances. This change aims to make exception
projections composable for easy consumption by a recursive algorithm by adding
an innerProjection parameter to IExceptionProject.Project. The individual impl
can decide whether or not it wants to project the inner exception. Additionally,
it can project it using custom logic or using the specified innerProjection, or
it could ignore it completely. The implementations have all the decision making
power.
2018-03-01 12:36:00 -05:00
Michael Handschuh c8f20b7756 Add IExceptionProjection infrastructure
Provides a sample implementation of IExceptionProjection that
prepends the scheduld event name to the error message

 #1630
2018-03-01 12:36:00 -05:00