From dcde8d69d830e126f5b6f784b7262cda5a4a1028 Mon Sep 17 00:00:00 2001 From: TomSchimansky Date: Thu, 15 Sep 2022 13:39:03 +0200 Subject: [PATCH] added CTk zoom behavior test --- .../test_ctk_appearance_mode_change.py | 3 --- .../test_ctk_iconify_at_beginning.py | 0 .../test_ctk_withdraw_at_beginning.py | 0 .../test_ctk_zoomed_state.py | 27 +++++++++++++++++++ 4 files changed, 27 insertions(+), 3 deletions(-) rename test/manual_integration_tests/{test_ctk_window_behavior => test_window_behavior}/test_ctk_appearance_mode_change.py (95%) rename test/manual_integration_tests/{test_ctk_window_behavior => test_window_behavior}/test_ctk_iconify_at_beginning.py (100%) rename test/manual_integration_tests/{test_ctk_window_behavior => test_window_behavior}/test_ctk_withdraw_at_beginning.py (100%) create mode 100644 test/manual_integration_tests/test_window_behavior/test_ctk_zoomed_state.py diff --git a/test/manual_integration_tests/test_ctk_window_behavior/test_ctk_appearance_mode_change.py b/test/manual_integration_tests/test_window_behavior/test_ctk_appearance_mode_change.py similarity index 95% rename from test/manual_integration_tests/test_ctk_window_behavior/test_ctk_appearance_mode_change.py rename to test/manual_integration_tests/test_window_behavior/test_ctk_appearance_mode_change.py index ae77337..c7bb4d8 100644 --- a/test/manual_integration_tests/test_ctk_window_behavior/test_ctk_appearance_mode_change.py +++ b/test/manual_integration_tests/test_window_behavior/test_ctk_appearance_mode_change.py @@ -7,9 +7,6 @@ customtkinter.set_appearance_mode("dark") app = customtkinter.CTk() app.geometry("400x240") -app.withdraw() -app.after(2000, app.deiconify) - def change_appearance_mode(): # test appearance mode change while withdrawn diff --git a/test/manual_integration_tests/test_ctk_window_behavior/test_ctk_iconify_at_beginning.py b/test/manual_integration_tests/test_window_behavior/test_ctk_iconify_at_beginning.py similarity index 100% rename from test/manual_integration_tests/test_ctk_window_behavior/test_ctk_iconify_at_beginning.py rename to test/manual_integration_tests/test_window_behavior/test_ctk_iconify_at_beginning.py diff --git a/test/manual_integration_tests/test_ctk_window_behavior/test_ctk_withdraw_at_beginning.py b/test/manual_integration_tests/test_window_behavior/test_ctk_withdraw_at_beginning.py similarity index 100% rename from test/manual_integration_tests/test_ctk_window_behavior/test_ctk_withdraw_at_beginning.py rename to test/manual_integration_tests/test_window_behavior/test_ctk_withdraw_at_beginning.py diff --git a/test/manual_integration_tests/test_window_behavior/test_ctk_zoomed_state.py b/test/manual_integration_tests/test_window_behavior/test_ctk_zoomed_state.py new file mode 100644 index 0000000..9bf1e59 --- /dev/null +++ b/test/manual_integration_tests/test_window_behavior/test_ctk_zoomed_state.py @@ -0,0 +1,27 @@ +import customtkinter + +customtkinter.set_appearance_mode("dark") + + +app = customtkinter.CTk() +app.geometry("400x240") + + +def change_appearance_mode(): + # test zoom with withdraw + app.after(1000, lambda: app.state("zoomed")) + app.after(2000, app.withdraw) + app.after(3000, app.deiconify) + app.after(4000, lambda: app.state("normal")) + + # test zoom with iconify + app.after(5000, lambda: app.state("zoomed")) + app.after(6000, app.iconify) + app.after(7000, app.deiconify) + app.after(8000, lambda: app.state("normal")) + + +button_1 = customtkinter.CTkButton(app, text="start test", command=change_appearance_mode) +button_1.pack(pady=20, padx=20) + +app.mainloop()