Commit 03e8b27e authored by Ayush Tiwari's avatar Ayush Tiwari

add tests

parent df954148
......@@ -15,6 +15,7 @@ optionflags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
GIT_REPOSITORY = 'https://lab.nexedi.com/nexedi/slapos.recipe.build.git'
BAD_GIT_REPOSITORY = 'http://git.erp5.org/repos/nowhere'
GIT_REPOSITORY_WITH_SUBMODULES = 'https://lab.nexedi.com/tiwariayush/erp5'
REVISION = '2566127'
def setUp(test):
......@@ -126,6 +127,27 @@ class GitCloneNonInformativeTests(unittest.TestCase):
def test_ignore_ssl_certificate_false(self):
self.test_ignore_ssl_certificate(ignore_ssl_certificate=False)
def test_clone_submodules_by_default(self, ignore_submodules=False):
recipe = self.makeGitCloneRecipe(
{'repository': GIT_REPOSITORY_WITH_SUBMODULES,
'branch': 'pyodide',
'clone_submodules': str(ignore_submodules).lower()}
)
recipe.install()
git_repository_path = os.path.join(self.parts_directory_path, "test")
self.assertTrue(os.path.exists(git_repository_path))
submodule_repo_path = os.path.join(git_repository_path, "bt5/erp5_notebook")
# Check if the folder exists
self.assertTrue(os.path.exists(git_repository_path))
# Check is there is anything in submodule repository path
if not ignore_submodules:
self.assertTrue(os.listdir(submodule_repo_path))
else:
self.assertFalse(os.listdir(submodule_repo_path))
def test_ignore_cloning_submodules(self):
self.test_clone_ignore_submodules_by_default(ignore_submodules=True)
def test_suite():
suite = unittest.TestSuite((
doctest.DocFileSuite(
......
......@@ -153,7 +153,6 @@ class Recipe(object):
self.networkcache = buildout.get('networkcache', {})
# Check if input is correct
if not self.repository:
raise UserError('repository parameter is mandatory.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment