def slug(self): #: For instances of this class, the slug is derived from the #: :attr:`barcode`. if not self.barcode is None: slug = slug_from_string(self.barcode) else: slug = None return slug
def test_init(self, request, iso_fac_name): iso_fac = request.getfuncargvalue(iso_fac_name) iso = iso_fac() check_attributes(iso, iso_fac.init_kw) assert len(iso.iso_stock_racks) == 0 assert len(iso.iso_sector_stock_racks) == 0 assert len(iso.iso_preparation_plates) == 0 assert len(iso.iso_aliquot_plates) == 0 if iso_fac_name == 'stock_sample_creation_iso_fac': assert len(iso.iso_sector_preparation_plates) == 0 else: assert len(iso.final_plates) == 0 assert iso.slug == slug_from_string(iso.label)
def test_init(self, species_fac): spec = species_fac() check_attributes(spec, species_fac.init_kw) assert spec.slug == slug_from_string(spec.common_name)
def slug(self): """ The slug is derived from the :attr:`hash_value`. """ return slug_from_string(self._hash_value)
def slug(self): #: For instances of this class, the slug is derived from the #: :attr:`common_name`. return slug_from_string(self.common_name)
def test_init(self, reservoir_specs_fac): rs = reservoir_specs_fac() check_attributes(rs, reservoir_specs_fac.init_kw) assert rs.slug == slug_from_string(rs.name)
def slug(self): #: The slug for instances of this class is derived from the #: :attr:`name`. return slug_from_string(self.name)
def slug(self): """ The slug of a reservoir spec is its :class:`name`. """ return slug_from_string(self._name)
def test_init(self, user_fac): user = user_fac() check_attributes(user, user_fac.init_kw) assert user.slug == slug_from_string(user.directory_user_id)
def slug(self): #: For instance of this class the slug is composed as follows: #: [:attr:`domain` \: :attr:`predicate` \= :attr:`value`\] #: (without white space around the special characters). return slug_from_string("%s:%s=%s" % (self.domain, self.predicate, self.value))
def slug(self): #: For instances of this class, the slug is derived from the #: :attr:`username`. return slug_from_string(self.user.username + '_' + self.app_name)
def slug(self): #: For instances of this class, the slug is derived from the #: :attr:`username`. return slug_from_string(self.directory_user_id)
def slug(self): #: For instances of this class, the slug is derived from the #: :attr:`accession`. return slug_from_string(self.accession)
def slug(self): """ The slug for molecule design libraries is derived from the :attr:`label`. """ return slug_from_string(self.label)
def test_basic(self): str_input = "spaces with_underscore AND CAPS" str_as_slug = "spaces-with-underscore-and-caps" slug = slug_from_string(str_input) self.assert_equal(slug, str_as_slug)
def reservoir_specs_std96(): agg = get_root_aggregate(IReservoirSpecs) return agg.get_by_slug(slug_from_string(RESERVOIR_SPECS_NAMES.STANDARD_96))
def reservoir_specs_std96(): agg = get_root_aggregate(IReservoirSpecs) return agg.get_by_slug( slug_from_string(RESERVOIR_SPECS_NAMES.STANDARD_96))
def slug(self): """ The slug of a planned transfer is its :attr:`name`. """ return slug_from_string(self._name)
def test_get_slug_from_string(self): self.assert_equal(slug_from_string('a b_C'), 'a-b-c')
def test_init(self, gene_fac): gene = gene_fac() assert gene.slug == slug_from_string(gene.accession) check_attributes(gene, gene_fac.init_kw)
def slug(self): #: For instances of this class, the slug is derived from the #: :attr:`hash_value`. return slug_from_string(self._hash_value)
def slug(self): return slug_from_string("%s-%s" % (self.last_name, self.first_name))
def test_init(self, organization_fac): org = organization_fac() check_attributes(org, organization_fac.init_kw) assert org.slug == slug_from_string(org.name)
def test_init(self, molecule_type_fac): mt = molecule_type_fac() check_attributes(mt, molecule_type_fac.init_kw) assert mt.slug == slug_from_string(mt.name)
def slug(self): return slug_from_string(self.name)
def slug(self): #: For instances of this class, the slug is derived from the #: :attr:`label`. return slug_from_string(self.label)
def __get_structure_type(self): agg = get_root_aggregate(IChemicalStructureType) return agg.get_by_slug(slug_from_string(self.structure_type_id))
def test_init(self, barcoded_location_fac): bl = barcoded_location_fac() check_attributes(bl, barcoded_location_fac.init_kw) assert bl.rack is None assert bl.slug == slug_from_string(bl.name)
def test_init(self, user_preferences_fac): up = user_preferences_fac() check_attributes(up, user_preferences_fac.init_kw) assert up.slug == slug_from_string("%s_%s" % (up.user.username, up.app_name))
def slug(self): return slug_from_string( "%s-%s-%s-%s" % (self.genus_name, self.species_name, '' if self.cultivar is None else self.cultivar, '' if self.author is None else self.author))
def test_init(self, item_status_fac): its = item_status_fac() check_attributes(its, item_status_fac.init_kw) assert its.slug == slug_from_string(its.name)
def test_init(self, project_fac): proj = project_fac() check_attributes(proj, project_fac.init_kw) assert proj.slug == slug_from_string(proj.label)
def test_init(self, tag_fac): tag = tag_fac() check_attributes(tag, tag_fac.init_kw) assert tag.slug == \ slug_from_string("%s:%s=%s" % (tag.domain, tag.predicate, tag.value))