summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-08-15 19:44:40 +0100
committerLars Wirzenius <liw@liw.fi>2011-08-15 19:44:40 +0100
commitb04a7c15ed5ca49607ec5cf4b456c0c2bbd1c30d (patch)
treeacd1be33729d4d9bc9271f701e5bd3432859ee22
parent11dc164ac731e630ba6cd54ac4136cb662387c1b (diff)
downloadcmdtest-b04a7c15ed5ca49607ec5cf4b456c0c2bbd1c30d.tar.gz
Start implementing cmdtest for real.
-rw-r--r--Makefile25
-rw-r--r--cmdtest.py32
-rw-r--r--cmdtest_tests.py32
-rw-r--r--without-tests0
4 files changed, 89 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..11e7a27
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+# Copyright 2011 Lars Wirzenius
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+all:
+
+check:
+ python -m CoverageTestRunner --ignore-missing-from=without-tests
+ rm .coverage
+
+clean:
+ rm -f *.py[co]
+
diff --git a/cmdtest.py b/cmdtest.py
new file mode 100644
index 0000000..be2827d
--- /dev/null
+++ b/cmdtest.py
@@ -0,0 +1,32 @@
+# Copyright 2011 Lars Wirzenius
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+__version__ = '0.0'
+
+
+class TestDir(object):
+
+ '''Contain information about a directory of test cases.'''
+
+ def __init__(self):
+ self.setup = None
+ self.setup_once = None
+ self.tests = []
+ self.teardown = None
+ self.teardown_once = None
+
+ def scan(self, dirname, filenames=None):
+ pass
diff --git a/cmdtest_tests.py b/cmdtest_tests.py
new file mode 100644
index 0000000..6a8f217
--- /dev/null
+++ b/cmdtest_tests.py
@@ -0,0 +1,32 @@
+# Copyright 2011 Lars Wirzenius
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import unittest
+
+from cmdtest import TestDir
+
+
+class TestDirTests(unittest.TestCase):
+
+ def test_finds_nothing_for_empty_directory(self):
+ td = TestDir()
+ td.scan('tests', filenames=[])
+ self.assertEqual(td.setup_once, None)
+ self.assertEqual(td.setup, None)
+ self.assertEqual(td.tests, [])
+ self.assertEqual(td.teardown, None)
+ self.assertEqual(td.teardown_once, None)
+
diff --git a/without-tests b/without-tests
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/without-tests