mirror of
https://github.com/scito/extract_otp_secrets.git
synced 2025-12-18 08:12:26 +01:00
refactor to satisfy flak8
This commit is contained in:
@@ -24,6 +24,7 @@ import os
|
||||
|
||||
import extract_otp_secret_keys
|
||||
|
||||
|
||||
def test_extract_csv():
|
||||
# Arrange
|
||||
cleanup()
|
||||
@@ -35,11 +36,12 @@ def test_extract_csv():
|
||||
expected_csv = read_csv('example_output.csv')
|
||||
actual_csv = read_csv('test_example_output.csv')
|
||||
|
||||
assert actual_csv == actual_csv
|
||||
assert actual_csv == expected_csv
|
||||
|
||||
# Clean up
|
||||
cleanup()
|
||||
|
||||
|
||||
def test_extract_json():
|
||||
# Arrange
|
||||
cleanup()
|
||||
@@ -55,13 +57,16 @@ def test_extract_json():
|
||||
# Clean up
|
||||
cleanup()
|
||||
|
||||
|
||||
def cleanup():
|
||||
remove_file('test_example_output.csv')
|
||||
remove_file('test_example_output.json')
|
||||
|
||||
|
||||
def remove_file(filename):
|
||||
if os.path.exists(filename): os.remove(filename)
|
||||
|
||||
|
||||
def read_csv(filename):
|
||||
"""Returns a list of lines."""
|
||||
with open(filename, "r") as infile:
|
||||
@@ -71,6 +76,7 @@ def read_csv(filename):
|
||||
lines.append(line)
|
||||
return lines
|
||||
|
||||
|
||||
def read_json(filename):
|
||||
"""Returns a list or a dictionary."""
|
||||
with open(filename, "r") as infile:
|
||||
|
||||
Reference in New Issue
Block a user