Use separate test file for base modules
This allows to filter them with the command line option. review9051002
This commit is contained in:
1 parent
20484bb013
commit
44693df703
4 files changed
+42
-17
No files matched your search
@@ -0,0 +1,14 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import unittest
|
||||
|
||||
from .test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class IrTestCase(ModuleTestCase):
|
||||
'Test ir module'
|
||||
module = 'ir'
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromTestCase(IrTestCase)
|
||||
@@ -0,0 +1,14 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import unittest
|
||||
|
||||
from .test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class ResTestCase(ModuleTestCase):
|
||||
'Test res module'
|
||||
module = 'res'
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromTestCase(ResTestCase)
|
||||
@@ -199,21 +199,6 @@ class ModuleTestCase(unittest.TestCase):
|
||||
})
|
||||
|
||||
|
||||
class IrTestCase(ModuleTestCase):
|
||||
'Test ir module'
|
||||
module = 'ir'
|
||||
|
||||
|
||||
class ResTestCase(ModuleTestCase):
|
||||
'Test res module'
|
||||
module = 'res'
|
||||
|
||||
|
||||
class WebDAVTestCase(ModuleTestCase):
|
||||
'Test webdav module'
|
||||
module = 'webdav'
|
||||
|
||||
|
||||
def db_exist():
|
||||
Database = backend.get('Database')
|
||||
database = Database().connect()
|
||||
@@ -254,8 +239,6 @@ def all_suite(modules=None):
|
||||
Return all tests suite of current module
|
||||
'''
|
||||
suite_ = suite()
|
||||
for case in [IrTestCase, ResTestCase, WebDAVTestCase]:
|
||||
suite_.addTests(unittest.TestLoader().loadTestsFromTestCase(case))
|
||||
for fn in os.listdir(os.path.dirname(__file__)):
|
||||
if fn.startswith('test_') and fn.endswith('.py'):
|
||||
if modules and fn[:-3] not in modules:
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import unittest
|
||||
|
||||
from .test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class WebDAVTestCase(ModuleTestCase):
|
||||
'Test ir module'
|
||||
module = 'webdav'
|
||||
|
||||
|
||||
def suite():
|
||||
return unittest.TestLoader().loadTestsFromTestCase(WebDAVTestCase)
|
||||
Reference in new issue
Block a user