def test_get_current_artifacts(self): """ Project.get_current_artifacts returns the current set of artifacts for this project. """ project = ProjectFactory.create() job = JobFactory.create() dependency = DependencyFactory.create(job=job) ProjectDependency.objects.create( project=project, dependency=dependency) build1 = BuildFactory.create(job=job) build2 = BuildFactory.create(job=job) ArtifactFactory.create(build=build1) artifact2 = ArtifactFactory.create(build=build2) self.assertEqual([artifact2], list(project.get_current_artifacts()))
def test_get_current_artifacts(self): """ Project.get_current_artifacts returns the current set of artifacts for this project. """ project = ProjectFactory.create() job = JobFactory.create() dependency = DependencyFactory.create(job=job) ProjectDependency.objects.create(project=project, dependency=dependency) build1 = BuildFactory.create(job=job) build2 = BuildFactory.create(job=job) ArtifactFactory.create(build=build1) artifact2 = ArtifactFactory.create(build=build2) process_build_dependencies(build2.pk) self.assertEqual([artifact2], list(project.get_current_artifacts()))
def test_projectbuild_list_view(self): """ The list view should provide a list of projects. """ job = JobFactory.create() BuildFactory.create_batch(5, job=job) project = ProjectFactory.create() ProjectDependency.objects.create( project=project, dependency=DependencyFactory.create(job=job)) projectbuild = ProjectBuildFactory.create(project=project) BuildFactory.create(job=job, build_id=projectbuild.build_id) url = reverse("project_projectbuild_list", kwargs={"pk": project.pk}) response = self.app.get(url, user="******") self.assertEqual(200, response.status_code) self.assertEqual( set([projectbuild]), set(response.context["projectbuilds"])) self.assertEqual(project, response.context["project"])
def test_instantiation(self): """We can create Dependencies.""" job = JobFactory.create() Dependency.objects.create( name="My Dependency", job=job)
def test_instantiation(self): """We can create Dependencies.""" job = JobFactory.create() Dependency.objects.create(name="My Dependency", job=job)