Skip to content

Commit 7e7f576

Browse files
authored
Merge pull request #357 from capocchi/version-5.1
bug fix
2 parents 76d97db + 811a0dc commit 7e7f576

25 files changed

Lines changed: 202 additions & 142 deletions

tests/ApplicationController.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
from config import UpdateBuiltins
4747

48-
#### Update the builtins variables
48+
# Update the builtins variables
4949
UpdateBuiltins()
5050

5151
class ApplicationController:
@@ -165,7 +165,7 @@ def RunTest(self, frame=None, show=True):
165165
if not frame:
166166
frame = wx.GetTopLevelWindows()[0]
167167

168-
### remove the show modal mode in order to close automatically
168+
# Remove the show modal mode in order to close automatically
169169
# style = frame.GetWindowStyleFlag()
170170
# if style & wx.DIALOG_MODAL:
171171
# frame.SetWindowStyleFlag(style & ~wx.DIALOG_MODAL)

tests/all.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
### lauch tests of all test_ files.
2-
### use: python all.py
1+
""" Launch tests of all test_ files.
2+
Usage: python all.py
3+
"""
34

45
import subprocess
56
import sys
@@ -21,4 +22,4 @@
2122
print(f"{test_file} testing...")
2223
subprocess.call(['python', test_file] + args)
2324

24-
print("All tests executed")
25+
print("All tests executed")

tests/test_aiprompterdialog.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
### lauch the test
2-
### python test_aiprompterdialog.py --autoclose
3-
### python test_aiprompterdialog.py --autoclose 10 (sleep time before to close the frame is 10s)
1+
"""Test script for AIPrompterDialog functionality.
2+
3+
Usage:
4+
python test_aiprompterdialog.py --autoclose
5+
python test_aiprompterdialog.py --autoclose 10 # Sleep time before closing frame is 10s
6+
"""
47

58
from ApplicationController import TestApp
69

7-
### import after ApplicationController that init sys.path ot avoid this import
10+
# import after ApplicationController that init sys.path ot avoid this import
811
from AIPrompterDialog import AIPrompterDialog
912

1013
# Crée un objet d'adaptateur fictif (à remplacer par votre propre logique)
@@ -18,8 +21,7 @@ def generate_output(self, full_prompt):
1821
# Code de démonstration
1922
demo_code = ""
2023

21-
### Run the test
24+
# Run the test
2225
app = TestApp(0)
2326
frame = AIPrompterDialog(None, 'Test', demo_code, DummyAdapter())
24-
app.RunTest(frame)
25-
27+
app.RunTest(frame)

tests/test_checkergui.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
### lauch the test
2-
### python test_checkergui.py --autoclose
3-
### python test_checkergui.py --autoclose 10 (sleep time before to close the frame is 10s)
1+
"""Test script for CheckerGUI functionality.
2+
3+
Usage:
4+
python test_checkergui.py --autoclose
5+
python test_checkergui.py --autoclose 10 # Sleep time before closing frame is 10s
6+
"""
47

58
from ApplicationController import TestApp
69

7-
### import after ApplicationController that init sys.path ot avoid this import
10+
# import after ApplicationController that init sys.path ot avoid this import
811
from CheckerGUI import CheckerGUI
912

10-
### Some input data to test case
13+
# Some input data to test case
1114
musicdata = {
1215
1 : ("Bad English", "The Price Of Love", "Rock"),
1316
2 : ("DNA featuring Suzanne Vega", "Tom's Diner", "Rock"),
@@ -65,7 +68,7 @@
6568
54: ("David Lanz", "Leaves on the Seine", "New Age"),
6669
}
6770

68-
### Run the test
71+
# Run the test
6972
app = TestApp(0)
7073
frame = CheckerGUI(None, "Test", musicdata)
7174
app.RunTest(frame)

tests/test_connectdialog.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
### lauch the test
2-
### python test_connectdialog.py --autoclose
3-
### python test_connectdialog.py --autoclose 10 (sleep time before to close the frame is 10s)
1+
"""Test script for ConnectDialog functionality.
2+
3+
Usage:
4+
python test_connectdialog.py --autoclose
5+
python test_connectdialog.py --autoclose 10 # Sleep time before closing frame is 10s
6+
"""
47

58
from ApplicationController import TestApp
69

7-
### import after ApplicationController that init sys.path ot avoid this import
10+
# import after ApplicationController that init sys.path ot avoid this import
811
from ConnectDialog import ConnectDialog
912

10-
### Run the test
13+
# Run the test
1114
app = TestApp(0)
1215
frame = ConnectDialog(None, -1, 'Test')
13-
app.RunTest(frame)
16+
app.RunTest(frame)

tests/test_detachedframe.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
### lauch the test
2-
### python test_detachedframe.py --autoclose
3-
### python test_detachedframe.py --autoclose 10 (sleep time before to close the frame is 10s)
1+
"""Test script for DetachedFrame functionality.
2+
3+
Usage:
4+
python test_detachedframe.py --autoclose
5+
python test_detachedframe.py --autoclose 10 # Sleep time before closing frame is 10s
6+
"""
47

58
from ApplicationController import TestApp
69

7-
### import after ApplicationController that init sys.path ot avoid this import
10+
# import after ApplicationController that init sys.path ot avoid this import
811
import Container
912
from DetachedFrame import DetachedFrame
1013

11-
### Run the test
14+
# Run the test
1215
app = TestApp(0)
1316
diagram = Container.Diagram()
1417
frame = DetachedFrame(None, -1, "Test", diagram)
15-
app.RunTest(frame)
16-
18+
app.RunTest(frame)
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11

2-
### lauch the test
3-
### python test_diagramconstantsdialog.py --autoclose
4-
### python test_diagramconstantsdialog.py --autoclose 10 (sleep time before to close the frame is 10s)
2+
"""Test script for DiagramConstantsDialog functionality.
3+
4+
Usage:
5+
python test_diagramconstantsdialog.py --autoclose
6+
python test_diagramconstantsdialog.py --autoclose 10 # Sleep time before closing frame is 10s
7+
"""
58

69
from ApplicationController import TestApp
710

8-
### import after ApplicationController that init sys.path ot avoid this import
11+
# import after ApplicationController that init sys.path ot avoid this import
912
from DiagramConstantsDialog import DiagramConstantsDialog
1013

11-
### Run the test
14+
# Run the test
1215
app = TestApp(0)
1316
diag = DiagramConstantsDialog(None, -1, "Test")
14-
app.RunTest(diag)
17+
app.RunTest(diag)

tests/test_draglist.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
### lauch the test
2-
### python test_draglist.py --autoclose
3-
### python test_draglist.py --autoclose 10 (sleep time before to close the frame is 10s)
1+
"""Test script for DragList functionality.
2+
3+
Usage:
4+
python test_draglist.py --autoclose
5+
python test_draglist.py --autoclose 10 # Sleep time before closing frame is 10s
6+
"""
47

58
from random import choice
69
import wx
710

811
from ApplicationController import TestApp
912

10-
### import after ApplicationController that init sys.path ot avoid this import
13+
# import after ApplicationController that init sys.path ot avoid this import
1114
from DragList import DragList
1215

1316
items = ['Foo', 'Bar', 'Baz', 'Zif', 'Zaf', 'Zof']
1417

15-
### Run the test
18+
# Run the test
1619
app = TestApp(0)
1720

1821
frame = wx.Frame(None, title='Test')
@@ -27,12 +30,10 @@
2730
sizer.Add(dl1, proportion=1, flag=wx.EXPAND)
2831
sizer.Add(dl2, proportion=1, flag=wx.EXPAND)
2932

30-
3133
for item in items:
3234
dl1.InsertItem(dl1.GetItemCount(), item)
3335
idx = dl2.InsertItem(dl2.GetItemCount(), item)
3436
dl2.SetItem(idx, 1, choice(items))
3537
dl2.SetItem(idx, 2, choice(items))
3638

37-
38-
app.RunTest(frame)
39+
app.RunTest(frame)

tests/test_editor.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
### lauch the test
2-
### python test_editor.py --autoclose
3-
### python test_editor.py --autoclose 10 (sleep time before to close the frame is 10s)
1+
"""Test script for Editor functionality.
2+
3+
Usage:
4+
python test_editor.py --autoclose
5+
python test_editor.py --autoclose 10 # Sleep time before closing frame is 10s
6+
"""
47

58
from tempfile import gettempdir
69
import os
@@ -9,7 +12,7 @@
912

1013
from Editor import GetEditor
1114

12-
### Run the test
15+
# Run the test
1316
fn = os.path.join(os.path.realpath(gettempdir()), 'test.py')
1417
with open(fn, 'w') as f:
1518
f.write("Hello world !")
@@ -30,5 +33,4 @@
3033
# frame3 = GetEditor(None, -1, 'Test3', None, file_type='block')
3134
# frame3.AddEditPage("Hello world", fn)
3235
# frame3.SetPosition((300, 300))
33-
# frame3.Show()
34-
36+
# frame3.Show()

tests/test_findgui.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
### lauch the test
2-
### python test_findgui.py --autoclose
3-
### python test_findgui.py --autoclose 10 (sleep time before to close the frame is 10s)
1+
"""Test script for FindGUI functionality.
2+
3+
Usage:
4+
python test_findgui.py --autoclose
5+
python test_findgui.py --autoclose 10 # Sleep time before closing frame is 10s
6+
"""
47

58
from ApplicationController import TestApp
69

7-
### import after ApplicationController that init sys.path ot avoid this import
10+
# import after ApplicationController that init sys.path ot avoid this import
811
from FindGUI import FindReplace
912

10-
### Run the test
13+
# Run the test
1114
app = TestApp(0)
1215
frame = FindReplace(None, -1, 'Test')
13-
app.RunTest(frame)
16+
app.RunTest(frame)

0 commit comments

Comments
 (0)