def test_no_download_for_ros_deps(self):
     """Test that we skip ROS packages."""
     downloader = Downloader(self.test_dir, [], [], use_preprint=False)
     roscpp_dep = Dependency(name="roscpp", url="irrelevant_link")
     std_msgs_dep = Dependency(name="std_msgs", url="irrelevant_link")
     dep_dict = {"roscpp": roscpp_dep, "std_msgs": std_msgs_dep}
     downloader.download_dependencies(dep_dict)
     expected_path = path.join(self.test_dir, 'roscpp')
     self.assertFalse(path.exists(expected_path))
     expected_path = path.join(self.test_dir, 'std_msgs')
     self.assertFalse(path.exists(expected_path))
Пример #2
0
 def test_update_deps(self):
     """Test that we can update the dictionary."""
     old_dict = {'test': Dependency(name='test')}
     new_dict = {
         'test2': Dependency(name='test2'),
         'test': Dependency(name='test', branch='blah')
     }
     updated_dict = Tools.update_deps_dict(old_dict, new_dict)
     self.assertTrue('test' in updated_dict)
     self.assertTrue('test2' in updated_dict)
     self.assertEqual('blah', updated_dict['test'].branch)
     pass
Пример #3
0
    def test_repository_exists(self):
        """Test behavior if repository exists."""
        http_url = "https://github.com/niosus/catkin_tools_fetch"
        dependency = Dependency(name='test', url=http_url)
        dep_res, exists = GitBridge.repository_exists(dependency)
        self.assertTrue(exists)
        self.assertEqual(dep_res.name, dependency.name)

        wrong_url = "https://github.com/niosus"
        dependency = Dependency(name='test', url=wrong_url)
        dep_res, exists = GitBridge.repository_exists(dependency)
        self.assertFalse(exists)
        dependency = Dependency(name='empty', url='')
        dep_res, exists = GitBridge.repository_exists(dependency)
        self.assertFalse(exists)
 def test_no_download_for_wrong_link(self):
     """Test that we download nothing for a wrong link."""
     downloader = Downloader(self.test_dir, [], [], use_preprint=False)
     dependency = Dependency(name="fetch", url="wrong_link")
     dep_dict = {"fetch": dependency}
     downloader.download_dependencies(dep_dict)
     expected_path = path.join(self.test_dir, 'fetch')
     self.assertFalse(path.exists(expected_path))
 def test_no_download_for_wrong_branch(self):
     """Test that we download nothing for a wrong branch."""
     downloader = Downloader(self.test_dir, [], [], use_preprint=False)
     dependency = Dependency(
         name="fetch",
         url="https://github.com/niosus/catkin_tools_fetch",
         branch="blahblah")
     dep_dict = {"fetch": dependency}
     downloader.download_dependencies(dep_dict)
     expected_path = path.join(self.test_dir, 'fetch')
     self.assertFalse(path.exists(expected_path))
 def test_download_dependencies_simple(self):
     """Test simple dependencies downloader."""
     downloader = Downloader(self.test_dir, [], [], use_preprint=False)
     dependency = Dependency(
         name="fetch",
         url="https://github.com/niosus/catkin_tools_fetch")
     dep_dict = {"fetch": dependency}
     downloader.download_dependencies(dep_dict)
     expected_path = path.join(self.test_dir,
                               'fetch',
                               'README.md')
     self.assertTrue(path.exists(expected_path))
Пример #7
0
 def test_init_partial(self):
     """Test partial initialization."""
     dep = Dependency(name="dep")
     self.assertEquals(dep.name, "dep")
     self.assertIsNone(dep.url)
     self.assertIsNone(dep.branch)
Пример #8
0
 def test_init(self):
     """Test initialization."""
     dep = Dependency(name="dep", url="url", branch="master")
     self.assertEquals(dep.name, "dep")
     self.assertEquals(dep.url, "url")
     self.assertEquals(dep.branch, "master")