def test_get_path_for_artifact(self): """ The default archive policy should return the path from the artifact url. """ artifact = ArtifactFactory.create(filename="testing.img") policy = DefaultPolicy() self.assertEqual( "testing.img", policy.get_path_for_artifact(artifact))
def test_get_path_for_artifact(self): """ The default archive policy should return the path from the artifact url. """ dependency = DependencyFactory.create(name="My Dependency") build = BuildFactory.create(job=dependency.job) artifact = ArtifactFactory.create(filename="testing.img", build=build) policy = DefaultPolicy() timestamp = "%s-%s" % (build.created_at.strftime("%Y-%m-%d"), time.mktime(build.created_at.timetuple())) self.assertEqual( "my-dependency/%s/testing.img" % timestamp, policy.get_path_for_artifact(artifact, dependency=dependency, build=build))
def test_get_path_for_artifact(self): """ The default archive policy should return the path from the artifact url. """ dependency = DependencyFactory.create(name="My Dependency") build = BuildFactory.create(job=dependency.job) artifact = ArtifactFactory.create( filename="testing.img", build=build) policy = DefaultPolicy() timestamp = "%s-%s" % ( build.created_at.strftime("%Y-%m-%d"), time.mktime(build.created_at.timetuple())) self.assertEqual( "my-dependency/%s/testing.img" % timestamp, policy.get_path_for_artifact( artifact, dependency=dependency, build=build))