From 4be673ff2d46eae22f3b372f424a72d2ee9a7d18 Mon Sep 17 00:00:00 2001 From: Luis Rodrigues Date: Fri, 18 Apr 2025 12:34:17 +0100 Subject: [PATCH] =?UTF-8?q?cria=C3=A7=C3=A3o=20de=20testes=20unit=C3=A1rio?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/__init__py | 0 tests/test_copier.py | 0 tests/test_organizer.py | 15 +++++++++++++++ tests/test_scanner.py | 0 4 files changed, 15 insertions(+) create mode 100644 tests/__init__py create mode 100644 tests/test_copier.py create mode 100644 tests/test_organizer.py create mode 100644 tests/test_scanner.py diff --git a/tests/__init__py b/tests/__init__py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_copier.py b/tests/test_copier.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_organizer.py b/tests/test_organizer.py new file mode 100644 index 0000000..23ba808 --- /dev/null +++ b/tests/test_organizer.py @@ -0,0 +1,15 @@ +import unittest +from organizer import categorizar_por_tipo +from pathlib import Path + + +class TestOrganizer(unittest.TestCase): + def test_categorizar_por_tipo(self): + self.assertEqual(categorizar_por_tipo("imagem.jpg"), "imagem") + self.assertEqual(categorizar_por_tipo("documento.pdf"), "documento") + self.assertEqual(categorizar_por_tipo("video.mp4"), "video") + self.assertEqual(categorizar_por_tipo("ficheiro.zip"), "outro") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_scanner.py b/tests/test_scanner.py new file mode 100644 index 0000000..e69de29