Hanno Böck commited on 2020-06-10 20:09:07
Zeige 2 geänderte Dateien mit 3 Einfügungen und 3 Löschungen.
| ... | ... |
@@ -19,7 +19,7 @@ class TestJsonLint(unittest.TestCase): |
| 19 | 19 |
def test_json_lint(self): |
| 20 | 20 |
valid = True |
| 21 | 21 |
for f in glob.glob("freewvsdb/*.json"):
|
| 22 |
- fp = open(f, "r") |
|
| 22 |
+ fp = open(f) |
|
| 23 | 23 |
orig = fp.read() |
| 24 | 24 |
fp.close() |
| 25 | 25 |
tmp = json.loads(orig) |
| ... | ... |
@@ -36,7 +36,7 @@ class TestJsonLint(unittest.TestCase): |
| 36 | 36 |
with open(cfile) as json_file: |
| 37 | 37 |
jconfig += json.load(json_file) |
| 38 | 38 |
|
| 39 |
- mkeys = set(['name', 'url', 'safe', 'vuln', 'detection']) |
|
| 39 |
+ mkeys = {'name', 'url', 'safe', 'vuln', 'detection'}
|
|
| 40 | 40 |
for item in jconfig: |
| 41 | 41 |
|
| 42 | 42 |
# check for all mandatory keys |
| ... | ... |
@@ -27,7 +27,7 @@ if not target: |
| 27 | 27 |
|
| 28 | 28 |
old = 0 |
| 29 | 29 |
if os.path.isfile(target + "timestamp"): |
| 30 |
- with open(target + "timestamp", "r") as f: |
|
| 30 |
+ with open(target + "timestamp") as f: |
|
| 31 | 31 |
old = int(f.read()) |
| 32 | 32 |
|
| 33 | 33 |
new = int(urllib.request.urlopen(DBURL + "freewvsdb.timestamp").read()) |
| 34 | 34 |