Permalink
Browse files

Checkpoint for tests.

Framework setup for tests and the setup script.  Still need to write
tests.
  • Loading branch information...
1 parent ad8bba9 commit f3128ceb9ac98c93d7d33feabaea1cf90ff29af4 @lyda committed Apr 8, 2012
Showing with 86 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. 0 __init__.py
  3. +35 −0 setup.py
  4. 0 tests/__init__.py
  5. +10 −0 tests/nine_mispellings.c
  6. +17 −0 tests/runall.py
  7. +22 −0 tests/test_file_ops.py
View
@@ -1 +1,3 @@
*.pyc
+misspellings.egg-info
+.*.swp
View
No changes.
View
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+from setuptools import setup
+
+requires = []
+
+try:
+ import re
+except ImportError:
+ requires.append('re')
+
+entry_points = {
+}
+
+setup(
+ name = "misspellings",
+ version = "1.0",
+ url = 'http://github.org/lyda',
+ author = 'Kevin Lyda',
+ author_email = 'kevin@ie.suberic.net',
+ description = "A tool to detect misspellings",
+ long_description=open('README.md').read(),
+ packages = ['misspellings', ],
+ include_package_data = True,
+ install_requires = requires,
+ test_suite = 'tests.runall',
+ # See http://pypi.python.org/pypi?%3Aaction=list_classifiers
+ classifiers = ['Development Status :: 5 - Production/Stable',
+ 'Environment :: Console',
+ 'License :: OSI Approved :: GNU Affero General Public License v3',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Topic :: Utilities',
+ ],
+)
View
No changes.
@@ -0,0 +1,10 @@
+ yrea [year],
+ yeras [years],
+ yersa [years],
+ yotube [youtube],
+ youseff [yousef],
+ youself [yourself],
+ ytou [you],
+ yuo [you],
+ zeebra [zebra],
+ }
View
@@ -0,0 +1,17 @@
+#!/usr/bin/python
+"""Run ***ALL*** the testorz!!!"""
+
+import unittest
+import imp
+import glob
+import os
+
+cwd = os.path.dirname(globals().get('__file__', os.getcwd()))
+
+test_list = [(os.path.basename(f)[:-3], f)
+ for f in glob.glob(os.path.join(cwd, 'test_*.py'))]
+print test_list
+for test_module, test_file in test_list:
+ test_runner = imp.load_source(test_module, test_file)
+ suite = unittest.defaultTestLoader.loadTestsFromModule(test_module)
+ unittest.TextTestRunner(verbosity=2).run(suite)
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+
+import os
+import sys
+import unittest
+
+# Set the path to load the module being tested.
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+print sys.path
+import misspellings.misspellings_lib as misspellings
+
+
+class IntegerArithmenticTestCase(unittest.TestCase):
+ def testAdd(self): ## test method names begin 'test*'
+ self.assertEqual((1 + 2), 3)
+ self.assertEqual(0 + 1, 1)
+ def testMultiply(self):
+ self.assertEqual((0 * 10), 0)
+ self.assertEqual((5 * 8), 40)
+
+if __name__ == '__main__':
+ unittest.main()

0 comments on commit f3128ce

Please sign in to comment.