From b5d899cdde01cc71cea2255c1c3c503fe62f1ffa Mon Sep 17 00:00:00 2001 From: afnanramadhan <13521011@std.stei.itb.ac.id> Date: Wed, 19 Apr 2023 20:13:09 +0700 Subject: [PATCH] refactor: pindah test to test folder --- {src => test}/test_dashboard.py | 4 ++++ {src => test}/test_endOfExe.py | 7 ++++++- {src => test}/test_listlatihan2.py | 5 +++++ {src => test}/test_plan.py | 4 ++++ {src => test}/test_plan2.py | 5 +++++ {src => test}/test_register.py | 5 +++++ 6 files changed, 29 insertions(+), 1 deletion(-) rename {src => test}/test_dashboard.py (95%) rename {src => test}/test_endOfExe.py (95%) rename {src => test}/test_listlatihan2.py (92%) rename {src => test}/test_plan.py (87%) rename {src => test}/test_plan2.py (94%) rename {src => test}/test_register.py (96%) diff --git a/src/test_dashboard.py b/test/test_dashboard.py similarity index 95% rename from src/test_dashboard.py rename to test/test_dashboard.py index 7608aef..19e42a4 100644 --- a/src/test_dashboard.py +++ b/test/test_dashboard.py @@ -1,5 +1,9 @@ import pytest import sys +import os + +path = os.getcwd() +sys.path.insert(0,f"{path}/src") from PyQt6.QtCore import Qt, pyqtSignal, QSize from PyQt6.QtGui import QCursor, QFont, QPixmap, QMovie, QIcon diff --git a/src/test_endOfExe.py b/test/test_endOfExe.py similarity index 95% rename from src/test_endOfExe.py rename to test/test_endOfExe.py index 15d2dbe..a81a111 100644 --- a/src/test_endOfExe.py +++ b/test/test_endOfExe.py @@ -3,9 +3,14 @@ import sys from PyQt6.QtWidgets import QApplication, QLabel, QWidget, QLineEdit, QPushButton, QRadioButton, QCheckBox, QMessageBox from PyQt6.QtGui import QFont, QPixmap, QCursor from PyQt6.QtCore import Qt, pyqtSignal -from endOfExercise import endOfExe +import sys +import os import pytest +path = os.getcwd() +sys.path.insert(0,f"{path}/src") +from endOfExercise import endOfExe + def test_endOfExe(qtbot): window = endOfExe() qtbot.addWidget(window) diff --git a/src/test_listlatihan2.py b/test/test_listlatihan2.py similarity index 92% rename from src/test_listlatihan2.py rename to test/test_listlatihan2.py index 1452fac..8eb8a44 100644 --- a/src/test_listlatihan2.py +++ b/test/test_listlatihan2.py @@ -1,4 +1,9 @@ from PyQt6.QtWidgets import QApplication +import sys +import os + +path = os.getcwd() +sys.path.insert(0,f"{path}/src") from listlatihan2 import listLatihan2 from PyQt6.QtCore import Qt, QSize, pyqtSignal from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie diff --git a/src/test_plan.py b/test/test_plan.py similarity index 87% rename from src/test_plan.py rename to test/test_plan.py index 7a0e5c3..497b813 100644 --- a/src/test_plan.py +++ b/test/test_plan.py @@ -3,7 +3,11 @@ import pytest from PyQt6.QtCore import Qt, pyqtSignal from PyQt6.QtGui import QPixmap, QCursor, QFont, QIcon from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QHBoxLayout, QVBoxLayout, QPushButton, QScrollArea +import sys +import os +path = os.getcwd() +sys.path.insert(0,f"{path}/src") from plan import plan @pytest.fixture diff --git a/src/test_plan2.py b/test/test_plan2.py similarity index 94% rename from src/test_plan2.py rename to test/test_plan2.py index 2eb3284..96e8072 100644 --- a/src/test_plan2.py +++ b/test/test_plan2.py @@ -1,6 +1,11 @@ import pytest from PyQt6.QtWidgets import QApplication, QWidget, QLabel, QPushButton from PyQt6.QtCore import Qt, QTimer, QTime +import sys +import os + +path = os.getcwd() +sys.path.insert(0,f"{path}/src") from plan2 import plan2 @pytest.fixture diff --git a/src/test_register.py b/test/test_register.py similarity index 96% rename from src/test_register.py rename to test/test_register.py index 82b4c96..4d2a5b6 100644 --- a/src/test_register.py +++ b/test/test_register.py @@ -2,6 +2,11 @@ import pytest from PyQt6.QtWidgets import QApplication, QLineEdit, QRadioButton, QCheckBox, QPushButton from PyQt6.QtCore import Qt +import sys +import os + +path = os.getcwd() +sys.path.insert(0,f"{path}/src") from register import register @pytest.fixture -- GitLab