def get_test_part(pname, ptype): # chunk.ProductType.SCIENCE is a common type chunks = TypedList(chunk.Chunk) chunks.append(ArtifactTestUtil.get_good_test_chunk(ptype)) test_part = part.Part(pname, ptype, chunks) return test_part
def get_parts(self): parts = collections.OrderedDict() _part = part.Part("x") if self.complete: _part.product_type = chunk.ProductType.SCIENCE if self.depth > 4: for _chunk in self.get_chunks(): _part.chunks.append(_chunk) parts["x"] = _part return parts
def get_test_artifact(ptype): # chunk.ProductType.SCIENCE is a common type if ptype is None: ptype = chunk.ProductType.SCIENCE test_artifact = artifact.Artifact('uri:foo/bar', ptype, artifact.ReleaseType.DATA) chunks = TypedList(chunk.Chunk) chunks.append(ArtifactTestUtil.get_good_test_chunk(ptype)) test_part = part.Part("test_part", ptype, chunks) test_artifact.parts = TypedOrderedDict(part.Part) test_artifact.parts['test_part'] = test_part return test_artifact