Coverage for lbCVMFSTools/TaskHandlers/NightliesInstallTask/tests/TestLocalConfig.py : 87%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
############################################################################### # (c) Copyright 2016 CERN # # # # This software is distributed under the terms of the GNU General Public # # Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # # # # In applying this licence, CERN does not waive the privileges and immunities # # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################### Test of the version path manager functionality in the model classes.
@author: Stefan-Gabriel CHITIC '''
import NightliesInstallTask SlotsManager, PathManager, InstalledManager
shutil.rmtree("/tmp/toto") shutil.rmtree("/tmp/foo/") "/tmp/toto/slot1/1235/.installed", 'w') as f: installArea="/tmp/toto/", workspace="/tmp/foo/") installOnCvmfs=False) 'cvmfs': [], 'afs': [ {'slot': 'slot1', 'build_id': 1235, 'platform': 'centos7_x64_opt', 'completed': True}, {'slot': 'slot2', 'build_id': 1243, 'platform': 'centos7_x64_opt', 'completed': False}, {'slot': 'slot1', 'build_id': 1235, 'platform': 'centos7_x86_opt', 'completed': False}, ]} # Mock Suprocess :
# Test with all slots not install c['completed'])) self.assertEqual(todos, parsed_slots)
# Mark 1 slot as installed c['platform'])]) c['completed']) todos = self.manager.get_list_of_tasks() self.assertEqual(todos, parsed_slots)
# Mark all as completed, check log c['platform'])]) "skipping" % (c['slot'], c['build_id'], c['platform'])) sorted(self.handler.messages['info']))
def test_perform_task(self): todos = self.manager.get_list_of_tasks()
# Perform 1 installation 'Need to fix the links for slot1 1235', 'Updating slot1 1235 centos7_x64_opt', 'Invoking: lbn-install --dest=/tmp/toto/' 'slot1/1235 --platforms=centos7_x64_opt slot1 1235', 'Install has changed - copying list of installed tars']
def test_lbn_install_call(self): todos = self.manager.get_list_of_tasks()
# Perform 1 installation with error self.mocked_return_code = 1 'Need to fix the links for slot1 1235', 'Updating slot1 1235 centos7_x64_opt', 'Invoking: lbn-install --dest=/tmp/toto/' 'slot1/1235 --platforms=centos7_x64_opt slot1 1235'] sorted(self.handler.messages['info'])) 'lbn-install --dest=/tmp/toto/' 'slot1/1235 --platforms=centos7_x64_opt ' 'slot1 1235')
if __name__ == "__main__": unittest.main() |