mirror of
https://github.com/scito/extract_otp_secrets.git
synced 2025-12-17 07:41:32 +01:00
refactor to satisfy flak8
This commit is contained in:
@@ -25,6 +25,7 @@ import os
|
||||
|
||||
import extract_otp_secret_keys
|
||||
|
||||
|
||||
class TestExtract(unittest.TestCase):
|
||||
|
||||
def test_extract_csv(self):
|
||||
@@ -53,9 +54,11 @@ class TestExtract(unittest.TestCase):
|
||||
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:
|
||||
@@ -65,6 +68,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