Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_struct_missing_parameter(self):
result = {
"BrokerID": "45544",
"FromCurrencyID": "",
"FromCurrencyUnit": 0.0,
"ToCurrencyID": "4334",
"ExchangeRate": 11.0
}
field = ApiStructure.ExchangeRateField(
BrokerID="45544",
ToCurrencyID="4334",
ExchangeRate=11.0
)
result_dict = field.to_dict()
self.assertDictEqual(result_dict, result)
def test_to_dict(self):
result = {
"BrokerID": "45544",
"FromCurrencyID": "4343",
"FromCurrencyUnit": 19.0,
"ToCurrencyID": "4334",
"ExchangeRate": 11.0
}
field = ApiStructure.ExchangeRateField(
BrokerID="45544",
FromCurrencyID="4343",
FromCurrencyUnit=19.0,
ToCurrencyID="4334",
ExchangeRate=11.0
)
result_dict = field.to_dict()
self.assertDictEqual(result, result_dict)