1
0
mirror of https://github.com/pyro2927/SouthwestCheckin.git synced 2025-12-06 01:13:19 +00:00

Fixing lint issues

This commit is contained in:
pyro2927
2019-02-17 22:47:24 -08:00
parent 950e377245
commit 232c833ae4
3 changed files with 11 additions and 9 deletions

View File

@@ -9,6 +9,7 @@ from tzlocal import get_localzone
my_vcr = custom_vcr()
@my_vcr.use_cassette()
def test_checkin():
r = southwest.Reservation('XXXXXX', 'John', 'Smith')
@@ -18,12 +19,6 @@ def test_checkin():
pytest.fail("Error checking in")
def test_timezone_localization():
tz = timezone('America/Los_Angeles')
date = tz.localize(datetime.strptime('2018-01-01 13:00', '%Y-%m-%d %H:%M'))
assert date.strftime('%z') == '-0800'
@my_vcr.use_cassette()
def test_openflights_api():
tzrequest = {'iata': 'LAX',

View File

@@ -14,6 +14,7 @@ bad_fields = [
'last-name'
]
def redact(obj):
for k, v in list(obj.items()):
if k in bad_fields:
@@ -24,6 +25,7 @@ def redact(obj):
elif isinstance(v, dict):
redact(v)
def filter_payload(response):
string_body = response['body']['string'].decode('utf8')
body = json.loads(string_body)
@@ -31,6 +33,7 @@ def filter_payload(response):
response['body']['string'] = json.dumps(body).encode()
return response
def custom_vcr():
dirname = os.path.dirname(__file__)
return VCR(