def test_newOrder_Post_amount7(): time.sleep(1) # Nonce can't be repeated and can be increased in one session payloadData = { "request": "", "nonce": "", "symbol": "btcusd", "amount": "7", "price": "9999.00", "side": "buy", "type": "exchange limit" } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post() print("Test Result: test_newOrder_btcusd_amount7()") print(end='\n') print(gemini_NewOrder) assert response.status_code == HTTP_SUCCESS print(end='\n')
def test_newOrder_btcusd_nonceNoIncrease4(): payloadData = { "request": "", "nonce": "", "client_order_id": "Lila_Test3", "symbol": "btcusd", "amount": "5", "min_amount": "2", "price": "3633.00", "side": "sell", "type": "exchange limit", "options": ["maker-or-cancel"] } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post() print("Test Result: test_newOrder_btcusd_nonceNoIncrease4()") print(end='\n') print(gemini_NewOrder) print(end='\n')
def test_newOrder_btcusd_invalidBaseURL(): time.sleep(1) # Nonce can't be repeated and can be increased in one session payloadData = { "request": "", "nonce": "", "symbol": "btcusd", "amount": "5", "price": "3633.00", "side": "buy", "type": "exchange limit" } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post_InvalidBaseURL() print("Test Result: test_newOrder_btcusd_invalidBaseURL()") print(end='\n') assert gemini_NewOrder == "NULL" print("new order = ", gemini_NewOrder) print("response = ", response) print(end='\n')
def test_newOrder_btcusd(): print(end='\n') print(end='\n') print("########## Executing Positive test suite where symbol = btcusd, with no optional parameters ##########") print(end='\n') payloadData = { "request": "", "nonce": "", "symbol": "btcusd", "amount": "5", "price": "3633.00", "side": "buy", "type": "exchange limit" } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post() print("Test Result: test_newOrder_btcusd()") print(end='\n') print(gemini_NewOrder) assert response.status_code == HTTP_SUCCESS print(end='\n')
def test_newOrder_ethusd(): print(end='\n') print(end='\n') print("########## Executing Positive test suite to test most other symbols, with no optional parameters ##########") print(end='\n') time.sleep(1) # Nonce can't be repeated and can be increased in one session payloadData = { "request": "", "nonce": "", "symbol": "ethusd", "amount": "5", "price": "3633.00", "side": "buy", "type": "exchange limit" } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post() print("Test Result: test_newOrder_ethusd()") print(end='\n') print(gemini_NewOrder) assert response.status_code == HTTP_SUCCESS print(end='\n')
def test_newOrder_btcusd_nonceNoIncrease1(): print(end='\n') print("########## Executing Negative test suite where the Nonce is not increasing ##########") print(" ~~~~~~~~~~ NOTE: Expecting some 'InvalidNonce' reason in the results ~~~~~~~~~~") print(end='\n') payloadData = { "request": "", "nonce": "", "client_order_id": "Lila_Test3", "symbol": "btcusd", "amount": "5", "min_amount": "2", "price": "3633.00", "side": "sell", "type": "exchange limit", "options": ["maker-or-cancel"] } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post() print("Test Result: test_newOrder_btcusd_nonceNoIncrease1()") print(end='\n') print(gemini_NewOrder) print(end='\n')
def test_newOrder_btcusd_invalidEndpoint(): print(end='\n') print(end='\n') print("########## Executing Negative test suite where endpoint/URL is invalid ##########") print(end='\n') time.sleep(1) # Nonce can't be repeated and can be increased in one session payloadData = { "request": "", "nonce": "", "symbol": "btcusd", "amount": "5", "price": "3633.00", "side": "buy", "type": "exchange limit" } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post_InvalidEndpoint() print("Test Result: test_newOrder_btcusd_invalidEndpoint()") print(end='\n') print(gemini_NewOrder) assert response.status_code != HTTP_SUCCESS print("Status code = ", response.status_code) print(end='\n')
def test_newOrder_btcusd_symbolMisspelled(): print(end='\n') print(end='\n') print("########## Executing Negative test suite, with some typos in parms and different symbols ##########") print(" ~~~~~~~~~~ NOTE: Expecting 'Invalid****' reasons in the results ~~~~~~~~~~") print(end='\n') time.sleep(1) # Nonce can't be repeated and can be increased in one session payloadData = { "request": "", "nonce": "", "symbol": "bbtcusd", "amount": "7", "price": "9999.00", "side": "buy", "type": "exchangee limit" } gemini_NewOrder, response = gemini_PostAPI_NewOrder(payloadData).newOrder_Post() print("Test Result: test_newOrder_btcusd_symbolMisspelled()") print(end='\n') print(gemini_NewOrder) assert response.status_code != HTTP_SUCCESS print("Status code = ", response.status_code) print(end='\n')