def test_UpToDateDependency(self): cue.setup['BASE'] = 'R3.15.6' cue.add_dependency('BASE') os.remove(self.licensefile) cue.add_dependency('BASE') self.assertFalse(os.path.exists(self.licensefile), 'Check out on top of existing up-to-date dependency')
def test_AddMsiTo314(self): cue.complete_setup('BASE') cue.setup['BASE'] = 'R3.14.12.1' msifile = os.path.join(cue.cachedir, 'base-R3.14.12.1', 'src', 'dbtools', 'msi.c') cue.add_dependency('BASE') self.assertTrue(os.path.exists(msifile), 'MSI was not added to Base 3.14')
def test_Default(self): cue.add_dependency('MCoreUtils') self.assertTrue( os.path.exists(self.testfile), 'Submodule (.ci) not checked out recursively (requested: default=YES' ) self.assertTrue( is_shallow_repo(self.location), 'Module not checked out shallow (requested: default=5)')
def test_MissingDependency(self): cue.setup['BASE'] = 'R3.15.6' cue.add_dependency('BASE') self.assertTrue(os.path.exists(self.licensefile), 'Missing dependency was not checked out') self.assertTrue(os.path.exists(self.checked_file), 'Checked-out commit marker was not written') with open(self.checked_file, 'r') as bfile: checked_out = bfile.read().strip() bfile.close() self.assertEqual(checked_out, self.hash_3_15_6, 'Wrong commit of dependency checked out (expected=\"{0}\" found=\"{1}\")' .format(self.hash_3_15_6, checked_out)) self.assertFalse(find_in_file('include \$\(TOP\)/../RELEASE.local', self.release_file), 'RELEASE in Base includes TOP/../RELEASE.local')
def test_OutdatedDependency(self): cue.setup['BASE'] = 'R3.15.6' cue.add_dependency('BASE') os.remove(self.licensefile) with open(self.checked_file, "w") as fout: print('XXX not the right hash XXX', file=fout) fout.close() cue.add_dependency('BASE') self.assertTrue(os.path.exists(self.licensefile), 'No check-out on top of out-of-date dependency') with open(self.checked_file, 'r') as bfile: checked_out = bfile.read().strip() bfile.close() self.assertEqual(checked_out, self.hash_3_15_6, "Wrong commit of dependency checked out (expected='{0}' found='{1}')" .format(self.hash_3_15_6, checked_out))
def test_SetDepthThree(self): cue.setup['MCoreUtils_DEPTH'] = '3' cue.add_dependency('MCoreUtils') self.assertTrue(is_shallow_repo(self.location), 'Module not checked out shallow (requested: depth=3)')
def test_SetDepthZero(self): cue.setup['MCoreUtils_DEPTH'] = '0' cue.add_dependency('MCoreUtils') self.assertFalse(is_shallow_repo(self.location), 'Module checked out shallow (requested full)')
def test_SetRecursiveNo(self): cue.setup['MCoreUtils_RECURSIVE'] = 'NO' cue.add_dependency('MCoreUtils') self.assertFalse(os.path.exists(self.testfile), 'Submodule (.ci) checked out recursively')