def setupDistroInfo(self): info = DistroInfo(repo_url=self.repo_url, repo_dir=self.repo_dir, distropath=self.distropath) distro_items = info.prepareTrees(self.repoFetch) self.distro_items = {} if distro_items: self.distro_items = distro_items
def test_prepareTrees_bad_url(self): test_url = "http://repos.fedorapeople.org/repos/pulp/pulp/BAD_URL_DOESNT_EXIST/" temp_label = "test_prepareTrees_bad_url" repo_dir = os.path.join(self.temp_dir, temp_label) info = DistroInfo(repo_url=test_url, repo_dir=repo_dir, distropath=self.temp_dir) repoFetch = RepoFetch() distro_items = info.prepareTrees(repoFetch) self.assertEquals(len(distro_items), 0)
def test_prepareTrees_no_treeinfo(self): test_url = "http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/repo_resync_a/" temp_label = "test_prepareTrees_no_treeinfo" repo_dir = os.path.join(self.temp_dir, temp_label) info = DistroInfo(repo_url=test_url, repo_dir=repo_dir, distropath=self.temp_dir) repoFetch = RepoFetch() distro_items = info.prepareTrees(repoFetch) self.assertEquals(len(distro_items), 0)
def test_prepareTrees(self): test_url = "http://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/pulp_unittest/" temp_label = "test_prepareTrees" repo_dir = os.path.join(self.temp_dir, temp_label) info = DistroInfo(repo_url=test_url, repo_dir=repo_dir, distropath=self.temp_dir) repoFetch = RepoFetch() distro_items = info.prepareTrees(repoFetch) self.assertEquals(len(distro_items['files']), 3)