diff --git a/mat2 b/mat2 index 272cd8f..a49b110 100755 --- a/mat2 +++ b/mat2 @@ -63,7 +63,12 @@ def show_meta(filename: str): return print("[+] Metadata for %s:" % filename) - for k, v in p.get_meta().items(): + meta = p.get_meta().items() + if not meta: + print(" No metadata found") + return + + for k, v in meta: try: # FIXME this is ugly. print(" %s: %s" % (k, v)) except UnicodeEncodeError: diff --git a/tests/test_climat2.py b/tests/test_climat2.py index a1f141c..9bb4ba3 100644 --- a/tests/test_climat2.py +++ b/tests/test_climat2.py @@ -81,6 +81,7 @@ class TestCleanFolder(unittest.TestCase): stdout=subprocess.PIPE) stdout, _ = proc.communicate() self.assertNotIn(b'Comment: Created with GIMP', stdout) + self.assertIn(b'No metadata found', stdout) shutil.rmtree('./tests/data/folder/')