Skip to content

Commit b92273d

Browse files
author
Ram Rachum
committed
-
1 parent c2d8bea commit b92273d

File tree

8 files changed

+25
-24
lines changed

8 files changed

+25
-24
lines changed

garlicsim/test_garlicsim/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,6 @@ def exists(module_name):
9191

9292

9393
def invoke_nose(arguments=_default_nose_arguments):
94+
'''Start Nose using this `test_garlicsim` test package.'''
9495
nose.run(defaultTest='test_garlicsim', argv=([sys.argv[0]] + arguments))
9596

garlicsim/test_garlicsim/test_misc/test_simpack_grokker/test_problematic_simpacks/test_problematic_simpacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_simpacks():
2929
simpacks = import_tools.import_all(problematic_simpacks_package).values()
3030

3131
# Making sure that we didn't miss any simpack by counting the number of
32-
# sub-folders in the `problematic_simpacks_package` folders:
32+
# sub-folders in the `simpacks` folder:
3333
simpacks_dir = \
3434
os.path.dirname(problematic_simpacks_package.__file__)
3535
assert len(

garlicsim/test_garlicsim/test_misc/test_simpack_grokker/test_simpack_grokker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_simpacks():
2323
simpacks = import_tools.import_all(simpacks_package).values()
2424

2525
# Making sure that we didn't miss any simpack by counting the number of
26-
# sub-folders in the `simpacks_package` folders:
26+
# sub-folders in the `simpacks` folder:
2727
simpacks_dir = os.path.dirname(simpacks_package.__file__)
2828
assert len(path_tools.list_sub_folders(simpacks_dir)) == \
2929
len(simpacks)

garlicsim/test_garlicsim/test_misc/test_step_profile/test_build_parser.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright 2009-2011 Ram Rachum.
22
# This program is distributed under the LGPL2.1 license.
33

4+
'''Testing module for `garlicsim.misc.StepProfile.build_parser`.'''
5+
46
import nose.tools
57

68
import garlicsim
@@ -12,15 +14,14 @@
1214

1315

1416
def test():
17+
'''Test the basic workings of `StepProfile.build_parser`.'''
18+
1519
verify_simpack_settings(simpack)
1620
simpack_grokker = garlicsim.misc.SimpackGrokker(simpack)
1721

18-
parse = \
19-
StepProfile.build_parser(simpack.State.step)
20-
alternate_parse = \
21-
StepProfile.build_parser(simpack.State.alternate_step)
22-
none_parse = \
23-
StepProfile.build_parser(None)
22+
parse = StepProfile.build_parser(simpack.State.step)
23+
alternate_parse = StepProfile.build_parser(simpack.State.alternate_step)
24+
none_parse = StepProfile.build_parser(None)
2425

2526

2627
default_step_profile = parse()
@@ -45,8 +46,6 @@ def test():
4546

4647
assert different_step_profile != step_profile
4748

48-
49-
5049

5150
alternate_step_profile = alternate_parse()
5251
assert alternate_step_profile == alternate_parse(z=3) == \

garlicsim_lib/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def get_packages():
6666

6767
my_long_description = \
6868
'''\
69-
A collection of GarlicSim simulation packages, for various scientific fields.
69+
Collection of GarlicSim simulation packages, for various scientific fields.
7070
7171
To be used with `garlicsim` and possibly `garlicsim_wx`.
7272

garlicsim_lib/test_garlicsim_lib/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def exists(module_name):
8989

9090

9191
def invoke_nose(arguments=_default_nose_arguments):
92+
'''Start Nose using this `test_garlicsim_lib` test package.'''
9293
nose.run(defaultTest='test_garlicsim_lib',
9394
argv=([sys.argv[0]] + arguments))
9495

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# tododoc: this module looks like crap
1+
# Copyright 2009-2011 Ram Rachum. No part of this program may be used, copied
2+
# or distributed without explicit written permission from Ram Rachum.
3+
4+
'''Defines an icon bundle for GarlicSim.'''
5+
6+
27
import pkg_resources
38

49
import wx
510

11+
from garlicsim.general_misc import caching
612

713

8-
_icon_bundle = None
9-
14+
@caching.cache()
1015
def get_icon_bundle():
11-
12-
global _icon_bundle
13-
14-
if _icon_bundle:
15-
return _icon_bundle
16+
'''Get GarlicSim's icon bundle.'''
1617

1718
from . import images as __images_package
1819
images_package = __images_package.__name__
1920

20-
2121
icons = []
2222
for size in [16, 24, 32, 48, 96, 128, 256]:
2323
file_name = 'icon%s.png' % str(size)
@@ -38,10 +38,9 @@ def get_icon_bundle():
3838
# todo: should probably be loading the bitmaps from the .ico file, to
3939
# save on storing all those PNGs.
4040

41-
42-
_icon_bundle = wx.IconBundle()
41+
icon_bundle = wx.IconBundle()
4342

4443
for icon in icons:
45-
_icon_bundle.AddIcon(icon)
44+
icon_bundle.AddIcon(icon)
4645

47-
return _icon_bundle
46+
return icon_bundle

garlicsim_wx/test_garlicsim_wx/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,6 @@ def exists(module_name):
8989

9090

9191
def invoke_nose(arguments=_default_nose_arguments):
92+
'''Start Nose using this `test_garlicsim_wx` test package.'''
9293
nose.run(defaultTest='test_garlicsim_wx', argv=([sys.argv[0]] + arguments))
9394

0 commit comments

Comments
 (0)