# HG changeset patch # User Sylvain Thénault # Date 1278492487 -7200 # Node ID e6cc50932720e6b1c49887b5e1a4da08dcee0f59 # Parent dc5a77a2e4856f5c56b615cd1414955e4e257a9d [skel] nicer test file skeleton diff -r dc5a77a2e485 -r e6cc50932720 skeleton/test/test_CUBENAME.py --- a/skeleton/test/test_CUBENAME.py Wed Jul 07 10:46:33 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. -# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr -# -# This file is part of CubicWeb. -# -# CubicWeb is free software: you can redistribute it and/or modify it under the -# terms of the GNU Lesser General Public License as published by the Free -# Software Foundation, either version 2.1 of the License, or (at your option) -# any later version. -# -# CubicWeb 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 Lesser General Public License for more -# details. -# -# You should have received a copy of the GNU Lesser General Public License along -# with CubicWeb. If not, see . -"""template automatic tests - -""" - -from logilab.common.testlib import TestCase, unittest_main - -class DefaultTC(TestCase): - def test_something(self): - self.skip('this cube has no test') - -## uncomment the import if you want to activate automatic test for your -## template - -# from cubicweb.devtools.testlib import AutomaticWebTest - - -if __name__ == '__main__': - unittest_main() diff -r dc5a77a2e485 -r e6cc50932720 skeleton/test/test_CUBENAME.py.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/skeleton/test/test_CUBENAME.py.tmpl Wed Jul 07 10:48:07 2010 +0200 @@ -0,0 +1,37 @@ +# copyright %(year)s %(author)s, all rights reserved. +# contact %(author-web-site)s -- mailto:%(author-email)s +# +%(long-license)s +"""%(distname)s automatic tests + + +uncomment code below if you want to activate automatic test for your cube: + +.. sourcecode:: python + + from cubicweb.devtools.testlib import AutomaticWebTest + + class AutomaticWebTest(AutomaticWebTest): + '''provides `to_test_etypes` and/or `list_startup_views` implementation + to limit test scope + ''' + + def to_test_etypes(self): + '''only test views for entities of the returned types''' + return set(('My', 'Cube', 'Entity', 'Types')) + + def list_startup_views(self): + '''only test startup views of the returned identifiers''' + return ('some', 'startup', 'views') +""" + +from cubicweb.devtools import testlib + +class DefaultTC(testlib.CubicWebTC): + def test_something(self): + self.skip('this cube has no test') + + +if __name__ == '__main__': + from logilab.common.testlib import unittest_main + unittest_main()