Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

Commit

Permalink
Also run simplesetup01 in regular unittests.
Browse files Browse the repository at this point in the history
As it turns out, "simplesetup01" is not simple. It is the only real
test we have to port from README.txt. In next step we can disable
README.txt if no working zope.app.testing is installed.
  • Loading branch information
ulif committed May 19, 2015
1 parent 331d168 commit c810f5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/z3c/testsetup/tests/test_samples.py
Expand Up @@ -8,6 +8,7 @@


CAVE_PATH = os.path.join(os.path.dirname(__file__), 'cave')
OTHER_CAVE_PATH = os.path.join(os.path.dirname(__file__), 'othercave')
LAYERED_CAVE_PATH = os.path.join(os.path.dirname(__file__), 'layered_cave')
GOT_WORKING_ZOPE_APP_TESTING = got_working_zope_app_testing()

Expand Down Expand Up @@ -207,6 +208,21 @@ def test_layeredsetup01(self):
assert "Total: 4 tests, 0 failures, 0 errors and 0 skipped" in (
cap.out)

def test_simplesetup01(self):
# we can run sample simplesetup01 from othercave.
defaults = [
'--path', OTHER_CAVE_PATH,
'--tests-pattern', '^simplesetup01$',
]
with Capture() as cap:
testrunner.run(defaults)
assert "Running testSetUp of UnitLayer1" in cap.out
assert "Running testSetUp of UnitLayer2" in cap.out
assert "Running testTearDown of UnitLayer2" in cap.out
assert "Running testTearDown of UnitLayer1" in cap.out
assert "Total: 10 tests, 0 failures, 0 errors and 0 skipped" in (
cap.out)


def tests_from_testcase(test_case):
return unittest.defaultTestLoader.loadTestsFromTestCase(test_case)
Expand Down

0 comments on commit c810f5e

Please sign in to comment.