From eb4ea93ac3a1bc1bb395ee0d74d72b08b3fe8190 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 12 Mar 2003 03:08:28 +0000 Subject: Import Samba Testing Framework code from private CVS module. (This used to be commit 0effe832a48f0c51d50675558cc2744e815d68c7) --- source3/stf/test.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 source3/stf/test.py (limited to 'source3/stf/test.py') diff --git a/source3/stf/test.py b/source3/stf/test.py new file mode 100755 index 0000000000..2e9abd976f --- /dev/null +++ b/source3/stf/test.py @@ -0,0 +1,28 @@ +#!/usr/bin/python + +# meta-test-case / example for comfychair. Should demonstrate +# different kinds of failure. + +import comfychair, stf + +class NormalTest(comfychair.TestCase): + def runTest(self): + pass + +class RootTest(comfychair.TestCase): + def setUp(self): + self.require_root() + + def runTest(self): + pass + +class GoodExecTest(comfychair.TestCase): + def runTest(self): + exit, stdout = self.runCmdUnchecked("ls -l") + +class BadExecTest(comfychair.TestCase): + def setUp(self): + exit, stdout = self.runCmdUnchecked("spottyfoot --slobber", + skip_on_noexec = 1) + +comfychair.runtests([NormalTest, RootTest, GoodExecTest, BadExecTest]) -- cgit From 52fbbf051b926cea44b9458289ea155d36a8bb7c Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 12 Mar 2003 07:17:39 +0000 Subject: Update for new version of ComfyChair: some methods are renamed to be more consistent, and it now looks at command-line arguments to work out what to do. Run this program to get a quick demonstration of what ComfyChair does. (This used to be commit 9b0c59a10707b2bbe3837d718e5030a6cdf19bfa) --- source3/stf/test.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'source3/stf/test.py') diff --git a/source3/stf/test.py b/source3/stf/test.py index 2e9abd976f..fb57926cc3 100755 --- a/source3/stf/test.py +++ b/source3/stf/test.py @@ -3,26 +3,31 @@ # meta-test-case / example for comfychair. Should demonstrate # different kinds of failure. -import comfychair, stf +import comfychair class NormalTest(comfychair.TestCase): - def runTest(self): + def runtest(self): pass class RootTest(comfychair.TestCase): - def setUp(self): + def setup(self): self.require_root() def runTest(self): pass class GoodExecTest(comfychair.TestCase): - def runTest(self): - exit, stdout = self.runCmdUnchecked("ls -l") + def runtest(self): + stdout = self.runcmd("ls -l") class BadExecTest(comfychair.TestCase): - def setUp(self): - exit, stdout = self.runCmdUnchecked("spottyfoot --slobber", - skip_on_noexec = 1) + def setup(self): + exit, stdout = self.runcmd_unchecked("spottyfoot --slobber", + skip_on_noexec = 1) + + +tests = [NormalTest, RootTest, GoodExecTest, BadExecTest] -comfychair.runtests([NormalTest, RootTest, GoodExecTest, BadExecTest]) +if __name__ == '__main__': + comfychair.main(tests) + -- cgit