Beispiel #1
0
    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)
Beispiel #2
0
 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)