예제 #1
0
 def test__update_root_links__formula_subdir_not_exist(
         self, mock_path_exists, mock_symlink, mock_link_dynamic_modules):
     """
     Test root links are made when our formula has no subdir docker/ structure
     """
     # Setup
     sample_dependencies = {
         'test_organisation/test1': {
             'source': '[email protected]:test_organisation/test1.git',
             'constraint': '==v1.0.1',
             'organisation': 'test_organisation',
             'name': 'test1'
         },
     }
     testobj = ShakerRemote(sample_dependencies)
     # Set path exists check values
     # False: formula-repos/docker-formula/docker exists
     # True: formula-repos/docker/ exists
     # False: _root/docker exists
     mock_path_exists.side_effect = [False, True, False]
     testobj._update_root_links()
     relative_source = "../formula-repos/test1"
     target = "vendor/_root/test1"
     mock_symlink.assert_called_once_with(relative_source, target)
     mock_link_dynamic_modules.assert_called_once_with("test1")
예제 #2
0
 def test__update_root_links__formula_dirs_not_exist(self,
                                                     mock_path_exists):
     """
     Test we have an exception when we can't find a any directory
     """
     # Setup
     sample_dependencies = {
         'test_organisation/test1-formula': {
             'source': '[email protected]:test_organisation/test1-formula.git',
             'constraint': '==v1.0.1',
             'organisation': 'test_organisation',
             'name': 'test1-formula'
         },
     }
     testobj = ShakerRemote(sample_dependencies)
     # Set path exists check values
     # True: formula-repos/docker-formula/docker exists
     # False: _root/docker exists
     mock_path_exists.side_effect = [
         False,
         False
     ]
     testobj._update_root_links()
     source = "vendor/formula-repos/test1-formula/test1"
     target = "vendor/_root/test1"
     mock_symlink.assert_called_with(source, target)
     mock_link_dynamic_modules.assert_called_with()
예제 #3
0
 def test__update_root_links__formula_link_exists(self,
                                                  mock_path_exists,
                                                  mock_symlink,
                                                  mock_link_dynamic_modules):
     """
     Test root links are made when our formula has no subdir docker-formula/ structure
     """
     # Setup
     sample_dependencies = {
         'test_organisation/test1-formula': {
             'source': '[email protected]:test_organisation/test1-formula.git',
             'constraint': '==v1.0.1',
             'organisation': 'test_organisation',
             'name': 'test1-formula'
         },
     }
     testobj = ShakerRemote(sample_dependencies)
     # Set path exists check values
     # True: formula-repos/docker-formula/docker exists
     # True: _root/docker exists
     mock_path_exists.side_effect = [
         True,
         True
     ]
     testobj._update_root_links()
예제 #4
0
 def test__update_root_links__formula_subdir_not_exist(self,
                                                       mock_path_exists,
                                                       mock_symlink,
                                                       mock_link_dynamic_modules):
     """
     Test root links are made when our formula has no subdir docker/ structure
     """
     # Setup
     sample_dependencies = {
         'test_organisation/test1': {
             'source': '[email protected]:test_organisation/test1.git',
             'constraint': '==v1.0.1',
             'organisation': 'test_organisation',
             'name': 'test1'
         },
     }
     testobj = ShakerRemote(sample_dependencies)
     # Set path exists check values
     # False: formula-repos/docker-formula/docker exists
     # True: formula-repos/docker/ exists
     # False: _root/docker exists
     mock_path_exists.side_effect = [
         False,
         True,
         False
     ]
     testobj._update_root_links()
     relative_source = "../formula-repos/test1"
     target = "vendor/_root/test1"
     mock_symlink.assert_called_once_with(relative_source, target)
     mock_link_dynamic_modules.assert_called_once_with("test1")
예제 #5
0
 def test__update_root_links__formula_link_exists(
         self, mock_path_exists, mock_symlink, mock_link_dynamic_modules):
     """
     Test root links are made when our formula has no subdir docker-formula/ structure
     """
     # Setup
     sample_dependencies = {
         'test_organisation/test1-formula': {
             'source': '[email protected]:test_organisation/test1-formula.git',
             'constraint': '==v1.0.1',
             'organisation': 'test_organisation',
             'name': 'test1-formula'
         },
     }
     testobj = ShakerRemote(sample_dependencies)
     # Set path exists check values
     # True: formula-repos/docker-formula/docker exists
     # True: _root/docker exists
     mock_path_exists.side_effect = [True, True]
     testobj._update_root_links()
예제 #6
0
 def test__update_root_links__formula_dirs_not_exist(
         self, mock_path_exists):
     """
     Test we have an exception when we can't find a any directory
     """
     # Setup
     sample_dependencies = {
         'test_organisation/test1-formula': {
             'source': '[email protected]:test_organisation/test1-formula.git',
             'constraint': '==v1.0.1',
             'organisation': 'test_organisation',
             'name': 'test1-formula'
         },
     }
     testobj = ShakerRemote(sample_dependencies)
     # Set path exists check values
     # True: formula-repos/docker-formula/docker exists
     # False: _root/docker exists
     mock_path_exists.side_effect = [False, False]
     testobj._update_root_links()
     source = "vendor/formula-repos/test1-formula/test1"
     target = "vendor/_root/test1"
     mock_symlink.assert_called_with(source, target)
     mock_link_dynamic_modules.assert_called_with()