def test_set_profile(token): """set it and then reset it to its current value""" original = main.get_status(token) new = { 'status_text': original['status_text'] + '!', 'status_emoji': original['status_emoji'], } expected = main.set_status(token, new) assert new == expected assert main.get_status(token) == expected
def status(): """ Return the status of the current sku. """ sku = request.form.get('sku') if not sku: sku = request.args.get('sku') response = main.get_status(sku) return jsonify(response)
def get_details(): """ Return product details when a URL with an SKU is entered manually, as opposed to being redirected from somewhere, which would redirect with all the necessary product details to set the state. """ url = request.args.get("url") sku = url.split("/")[-1] response = main.get_status(sku) if response.get("product_name") == None: abort(404) else: return jsonify(response)
import main dates_locations_prices_webs = main.get_status() print(dates_locations_prices_webs) n = int(input()) url = 'https://ticket.com.tw/application/UTK02/' + dates_locations_prices_webs[3][n] driver = main.get_chk_pic(url) # chk = input() # # loop for fail purchase until success by retry the chk_pic # while not main.ticket_buying(driver, 'A131892440', 'nono0627', '1', '0', '0', chk): # chk = input() # main.ticket_buying(driver, 'A131892440', 'nono0627', '1', '0', '0', chk)
def test_get_status(token): status = main.get_status(token) assert status is not None