mirror of
https://github.com/mvt-project/mvt.git
synced 2026-05-27 02:12:25 +02:00
Continuing enforcement of line length and simplifying date conversions
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
# https://license.mvt.re/1.1/
|
||||
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import tarfile
|
||||
|
||||
@@ -19,7 +18,7 @@ class TestBackupModule:
|
||||
|
||||
def test_module_folder(self):
|
||||
backup_path = get_android_backup_folder()
|
||||
mod = SMS(target_path=backup_path, log=logging)
|
||||
mod = SMS(target_path=backup_path)
|
||||
files = []
|
||||
for root, subdirs, subfiles in os.walk(os.path.abspath(backup_path)):
|
||||
for fname in subfiles:
|
||||
@@ -32,7 +31,7 @@ class TestBackupModule:
|
||||
|
||||
def test_module_file(self):
|
||||
fpath = os.path.join(get_android_backup_folder(), "backup.ab")
|
||||
mod = SMS(target_path=fpath, log=logging)
|
||||
mod = SMS(target_path=fpath)
|
||||
with open(fpath, "rb") as f:
|
||||
data = f.read()
|
||||
tardata = parse_backup_file(data)
|
||||
@@ -48,7 +47,7 @@ class TestBackupModule:
|
||||
|
||||
def test_module_file2(self):
|
||||
fpath = os.path.join(get_android_backup_folder(), "backup2.ab")
|
||||
mod = SMS(target_path=fpath, log=logging)
|
||||
mod = SMS(target_path=fpath)
|
||||
with open(fpath, "rb") as f:
|
||||
data = f.read()
|
||||
tardata = parse_backup_file(data, password="123456")
|
||||
@@ -64,7 +63,7 @@ class TestBackupModule:
|
||||
|
||||
def test_module_file3(self):
|
||||
fpath = os.path.join(get_android_backup_folder(), "backup3.ab")
|
||||
mod = SMS(target_path=fpath, log=logging)
|
||||
mod = SMS(target_path=fpath)
|
||||
with open(fpath, "rb") as f:
|
||||
data = f.read()
|
||||
tardata = parse_backup_file(data)
|
||||
|
||||
@@ -52,6 +52,7 @@ class TestBackupParsing:
|
||||
m.update(ddata)
|
||||
assert m.hexdigest() == "33e73df2ede9798dcb3a85c06200ee41c8f52dd2f2e50ffafcceb0407bc13e3a"
|
||||
sms = parse_tar_for_sms(ddata)
|
||||
print(sms)
|
||||
assert isinstance(sms, list)
|
||||
assert len(sms) == 1
|
||||
assert len(sms[0]["links"]) == 1
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# Use of this software is governed by the MVT License 1.1 that can be found at
|
||||
# https://license.mvt.re/1.1/
|
||||
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
@@ -17,7 +16,7 @@ class TestAppopsModule:
|
||||
|
||||
def test_appops_parsing(self):
|
||||
fpath = os.path.join(get_artifact_folder(), "android_data/bugreport/")
|
||||
m = Appops(target_path=fpath, log=logging, results=[])
|
||||
m = Appops(target_path=fpath)
|
||||
folder_files = []
|
||||
parent_path = Path(fpath).absolute().as_posix()
|
||||
for root, subdirs, subfiles in os.walk(os.path.abspath(fpath)):
|
||||
|
||||
@@ -14,6 +14,7 @@ class TestDumpsysParsing:
|
||||
file = get_artifact("android_data/dumpsys_appops.txt")
|
||||
with open(file) as f:
|
||||
data = f.read()
|
||||
|
||||
res = parse_dumpsys_appops(data)
|
||||
|
||||
assert len(res) == 12
|
||||
|
||||
Reference in New Issue
Block a user