()
| 16 | from ccxt.test.exchange.base import test_shared_methods # noqa E402 |
| 17 | |
| 18 | def test_io(): |
| 19 | exchange = ccxt.Exchange({ |
| 20 | 'id': 'sampleex', |
| 21 | }) |
| 22 | ms = exchange.milliseconds() |
| 23 | file_name = 'ccxt-test-io-' + str(ms) + '.ccxtfile' |
| 24 | # upper tmp dir |
| 25 | temp_dir = exchange.get_temp_dir() |
| 26 | assert temp_dir is not None and temp_dir != '', 'temp dir should not be empty' |
| 27 | file_path = temp_dir + file_name # '../../../../../../../../../../../../tmp/' + fileName; |
| 28 | file_content = 'hello world' |
| 29 | assert exchange.write_file(file_path, file_content), 'can not write file ' + file_path |
| 30 | assert exchange.exists_file(file_path), 'file does not exist: ' + file_path |
| 31 | read_content = exchange.read_file(file_path) |
| 32 | assert read_content == file_content, 'file content mismatch. Expected: ' + file_content + ', got: ' + read_content |
no test coverage detected
searching dependent graphs…