MCPcopy Index your code
hub / github.com/ccxt/ccxt / testBybit

Method testBybit

java/tests/src/main/java/tests/exchange/TestMain.java:2169–2194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2167 }
2168
2169 public java.util.concurrent.CompletableFuture<Object> testBybit()
2170 {
2171
2172 return java.util.concurrent.CompletableFuture.supplyAsync(() -> {
2173
2174 Exchange exchange = this.initOfflineExchange("bybit");
2175 Object reqHeaders = null;
2176 Object id = "CCXT";
2177 Assert(Helpers.isEqual(Helpers.GetValue(exchange.options, "brokerId"), id), "id not in options");
2178 try
2179 {
2180 (exchange.createOrder("BTC/USDT", "limit", "buy", 1, 20000)).join();
2181 } catch(Exception e)
2182 {
2183 // we expect an error here, we're only interested in the headers
2184 reqHeaders = exchange.last_request_headers;
2185 }
2186 Assert(Helpers.isEqual(Helpers.GetValue(reqHeaders, "Referer"), id), Helpers.add(Helpers.add("bybit - id: ", id), " not in headers."));
2187 if (!Helpers.isTrue(isSync()))
2188 {
2189 (close(exchange)).join();
2190 }
2191 return true;
2192 });
2193
2194 }
2195
2196 public java.util.concurrent.CompletableFuture<Object> testKucoin()
2197 {

Callers 1

runBrokerIdTestsMethod · 0.95

Calls 9

initOfflineExchangeMethod · 0.95
isEqualMethod · 0.95
GetValueMethod · 0.95
createOrderMethod · 0.95
addMethod · 0.95
isTrueMethod · 0.95
AssertMethod · 0.80
isSyncMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected