def setUp(self): tu.log_out() # to forget all (this is needed in case some test cases are failing # and thus forgot is not done on the test cases) json_data = json.dumps({'forget_all': 'ticks'}) tu.send_and_receive_ws_x_authorize(json_data) json_data = json.dumps({'forget_all': 'proposal'}) tu.send_and_receive_ws_x_authorize(json_data)
def tearDown(self): tu.log_out() # to forget all (this is needed in case some test cases are failing # and thus forgot is not done on the test cases) json_data = json.dumps({'forget_all': 'ticks'}) tu.send_and_receive_ws_x_authorize(json_data) json_data = json.dumps({'forget_all': 'proposal'}) tu.send_and_receive_ws_x_authorize(json_data) time.sleep( 1 ) # in case the script running too fast and next detected call is forget all
def test_website_status(self): tu.log_out() # log out so it will return client country as my input = json.dumps({"website_status": 1}) website_status_response = tu.send_and_receive_ws_x_authorize(input) prod_output = self.get_prod_output(input) # to convert python structure same as json output expected_website_status = tu.convert_py_json_output(prod_output) # Without authenticate token, it will return clients_country: my, or else, follow the account country self.assertTrue( tu.compare_data(website_status_response, expected_website_status)) self.assertTrue('error' not in website_status_response)
def test_payout_currencies(self): # Note this test case is design for unauthorise call. # If token is authenticated, it will return the currency which available for his account expected_payout_currencies = [ "AUD", "BCH", "BTC", "DAI", "ETH", "EUR", "GBP", "LTC", "USD", "UST" ] payout_currencies = json.dumps({"payout_currencies": 1}) tu.log_out( ) # log out so it will return full available payout currencies payout_currencies_reponse = tu.send_and_receive_ws_x_authorize( payout_currencies) payout_currencies_list = payout_currencies_reponse["payout_currencies"] self.assertTrue( set(expected_payout_currencies) == set(payout_currencies_list)) self.assertTrue("error" not in payout_currencies_reponse)
def setUp(self): tu.log_out() return