MCPcopy Create free account
hub / github.com/ccxt/ccxt / test_io

Function test_io

python/ccxt/test/base/test_io.py:18–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16from ccxt.test.exchange.base import test_shared_methods # noqa E402
17
18def 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

Callers 1

base_tests_initFunction · 0.90

Calls 6

millisecondsMethod · 0.95
get_temp_dirMethod · 0.95
write_fileMethod · 0.95
exists_fileMethod · 0.95
read_fileMethod · 0.95
ExchangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…