Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_check_new_round(api):
open_time = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
data = {"data": {"rounds": [{"openTime": open_time.isoformat()}]}}
responses.add(responses.POST, numerapi.numerapi.API_TOURNAMENT_URL,
json=data)
open_time = datetime.datetime(2000, 1, 1).replace(tzinfo=pytz.utc)
data = {"data": {"rounds": [{"openTime": open_time.isoformat()}]}}
responses.add(responses.POST, numerapi.numerapi.API_TOURNAMENT_URL,
json=data)
# first example
assert api.check_new_round()
# second
assert not api.check_new_round()
def test_check_new_round(api):
open_time = datetime.datetime.utcnow().replace(tzinfo=pytz.utc)
data = {"data": {"rounds": [{"openTime": open_time.isoformat()}]}}
responses.add(responses.POST, numerapi.numerapi.API_TOURNAMENT_URL,
json=data)
open_time = datetime.datetime(2000, 1, 1).replace(tzinfo=pytz.utc)
data = {"data": {"rounds": [{"openTime": open_time.isoformat()}]}}
responses.add(responses.POST, numerapi.numerapi.API_TOURNAMENT_URL,
json=data)
# first example
assert api.check_new_round()
# second
assert not api.check_new_round()