diff options
author | Quentin <quentin@dufour.io> | 2024-01-02 22:44:29 +0000 |
---|---|---|
committer | Quentin <quentin@dufour.io> | 2024-01-02 22:44:29 +0000 |
commit | b9a0c1e6eced036eb71e8221a4f236f72832fec2 (patch) | |
tree | c498a7a2a5833f2c6f27d4ba97894747f9d454c0 /tests/instrumentation/rm-mail-parser-expected-struct.py | |
parent | 6ff3c6f71efd802da422a371e6168ae528fb2ddc (diff) | |
parent | c9a33c080d39d4a2b269e3c8f166a708b6606da5 (diff) | |
download | aerogramme-b9a0c1e6eced036eb71e8221a4f236f72832fec2.tar.gz aerogramme-b9a0c1e6eced036eb71e8221a4f236f72832fec2.zip |
Merge pull request 'Implement imap-flow' (#34) from refactor/imap-flow into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/34
Diffstat (limited to 'tests/instrumentation/rm-mail-parser-expected-struct.py')
-rw-r--r-- | tests/instrumentation/rm-mail-parser-expected-struct.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/instrumentation/rm-mail-parser-expected-struct.py b/tests/instrumentation/rm-mail-parser-expected-struct.py new file mode 100644 index 0000000..3dbc56e --- /dev/null +++ b/tests/instrumentation/rm-mail-parser-expected-struct.py @@ -0,0 +1,17 @@ +from os import listdir +from os.path import isfile, join +import sys + +path = sys.argv[1] +onlyfiles = [join(path, f) for f in listdir(path) if isfile(join(path, f)) and len(f) > 4 and f[-4:] == ".txt"] + +for p in onlyfiles: + g = p[:-4] + ".eml" + print(f"{p} -> {g}") + with open(p, 'r+b') as inp: + with open(g, 'w+b') as out: + for line in inp: + if b"EXPECTED STRUCTURE" in line: + break + out.write(line) + |