(exchange, skipped_properties, method, entry, actual_code, expected_code=None, allow_null=True)
| 164 | |
| 165 | |
| 166 | def assert_currency_code(exchange, skipped_properties, method, entry, actual_code, expected_code=None, allow_null=True): |
| 167 | if ('currency' in skipped_properties) or ('currencyIdAndCode' in skipped_properties): |
| 168 | return |
| 169 | log_text = log_template(exchange, method, entry) |
| 170 | assert actual_code is not None or allow_null, 'currency code is null' + log_text |
| 171 | if actual_code is not None: |
| 172 | assert isinstance(actual_code, str), 'currency code should be either undefined or a string' + log_text |
| 173 | assert (actual_code in exchange.currencies), 'currency code ("' + actual_code + '") should be present in exchange.currencies' + log_text |
| 174 | if expected_code is not None: |
| 175 | assert actual_code == expected_code, 'currency code in response ("' + string_value(actual_code) + '") should be equal to expected code ("' + string_value(expected_code) + '")' + log_text |
| 176 | |
| 177 | |
| 178 | def assert_valid_currency_id_and_code(exchange, skipped_properties, method, entry, currency_id, currency_code, allow_null=True): |
no test coverage detected
searching dependent graphs…