bobtemplates.plone/tox: comment tests to make test steps clearer
Alexander Loechel <jenkins-z4DKO/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Repository: bobtemplates.plone Branch: refs/heads/tox Date: 2017-07-18T14:17:39+02:00 Author: Alexander Loechel (loechel) <[email protected]> Commit: https://github.com/plone/bobtemplates.plone/commit/d70ef0100d310c99e7f9b46bb2a227795b80df8d comment tests to make test steps clearer Files changed: M tests/test_hooks.py diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 929bc93..db605bb 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -31,38 +31,45 @@ def test_to_boolean(): def test_validate_packagename(): + # step 1: test None with pytest.raises(AttributeError): hooks.validate_packagename(None) + # step 2: test base namespace (level 2) configurator = Configurator( template='bobtemplates/plone_addon', target_directory='collective.foo') hooks.validate_packagename(configurator) + # step 3: test without namespace (level 1) with pytest.raises(SystemExit): configurator = Configurator( template='bobtemplates/plone_addon', target_directory='foo') hooks.validate_packagename(configurator) + # step 4: test deep nested namespace (level 4) with pytest.raises(SystemExit): configurator = Configurator( template='bobtemplates/plone_addon', target_directory='collective.foo.bar.spam') hooks.validate_packagename(configurator) + # step 5: test leading dot with pytest.raises(SystemExit): configurator = Configurator( template='bobtemplates/plone_addon', target_directory='.collective.foo') hooks.validate_packagename(configurator) + # step 6: test ending dot with pytest.raises(SystemExit): configurator = Configurator( template='bobtemplates/plone_addon', target_directory='collective.foo.') hooks.validate_packagename(configurator) + # step 7: test invalid char with pytest.raises(SystemExit): configurator = Configurator( template='bobtemplates/plone_addon', @@ -71,9 +78,11 @@ def test_validate_packagename(): def test_pre_username(): + # step 1: test None with pytest.raises(AttributeError): hooks.pre_username(None, None) + # step 2: test base namespace configurator = Configurator( template='bobtemplates/plone_addon', target_directory='collective.foo') ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot