コード例 #1
0
    def test_users(self, connect, dataset):
        users = UserCollection().fetch()
        assert(isinstance(users, UserCollection))

        users = UserCollection()
        users.append(User(random_string(), random_string(), random_string(), "*****@*****.**", random_string()))
        assert (users.save())
コード例 #2
0
    def test_users(self, connect, dataset):
        users = UserCollection().fetch()
        assert (isinstance(users, UserCollection))

        users = UserCollection()
        users.append(
            User(random_string(), random_string(), random_string(),
                 "*****@*****.**", random_string()))
        assert (users.save())
コード例 #3
0
    def test_storage(self, connect, dataset):
        name = random_string()
        storage = Storage(name, dataset["user"].id).save()
        assert (isinstance(storage, Storage))
        assert (storage.name == name)

        storage = Storage().fetch(storage.id)
        assert (isinstance(storage, Storage))
        assert (storage.name == name)

        name = random_string()
        storage.name = name
        storage.update()
        assert (isinstance(storage, Storage))
        assert (storage.name == name)
コード例 #4
0
    def test_terms(self, connect, dataset):
        terms = TermCollection().fetch()
        assert (isinstance(terms, TermCollection))

        terms = TermCollection()
        terms.append(Term(random_string(), dataset["ontology"].id, "#AAAAAA"))
        assert (terms.save())
コード例 #5
0
    def test_ontologies(self, connect, dataset):
        ontologies = OntologyCollection().fetch()
        assert (isinstance(ontologies, OntologyCollection))

        ontologies = OntologyCollection()
        ontologies.append(Ontology(random_string()))
        assert (ontologies.save())
コード例 #6
0
    def test_ontologies(self, connect, dataset):
        ontologies = OntologyCollection().fetch()
        assert (isinstance(ontologies, OntologyCollection))

        ontologies = OntologyCollection()
        ontologies.append(Ontology(random_string()))
        assert (ontologies.save())
コード例 #7
0
    def test_terms(self, connect, dataset):
        terms = TermCollection().fetch()
        assert (isinstance(terms, TermCollection))

        terms = TermCollection()
        terms.append(Term(random_string(), dataset["ontology"].id, "#AAAAAA"))
        assert (terms.save())
コード例 #8
0
    def test_softwares(self, connect, dataset):
        softwares = SoftwareCollection().fetch()
        assert (isinstance(softwares, SoftwareCollection))

        softwares = SoftwareCollection()
        softwares.append(Software(random_string(), "createRabbitJobWithArgsService", "ValidateAnnotation"))
        assert (softwares.save())
コード例 #9
0
    def test_groups(self, connect, dataset):
        groups = GroupCollection().fetch()
        assert (isinstance(groups, GroupCollection))

        groups = GroupCollection()
        groups.append(Group(random_string(), 200))
        assert (groups.save())
コード例 #10
0
    def test_groups(self, connect, dataset):
        groups = GroupCollection().fetch()
        assert(isinstance(groups, GroupCollection))

        groups = GroupCollection()
        groups.append(Group(random_string(), 200))
        assert (groups.save())
コード例 #11
0
    def test_disciplines(self, connect, dataset):
        disciplines = DisciplineCollection().fetch()
        assert (isinstance(disciplines, DisciplineCollection))

        disciplines = DisciplineCollection()
        disciplines.append(Discipline(random_string()))
        assert (disciplines.save())
コード例 #12
0
    def test_disciplines(self, connect, dataset):
        disciplines = DisciplineCollection().fetch()
        assert (isinstance(disciplines, DisciplineCollection))

        disciplines = DisciplineCollection()
        disciplines.append(Discipline(random_string()))
        assert (disciplines.save())
コード例 #13
0
    def test_ontology(self, connect, dataset):
        name = random_string()
        ontology = Ontology(name).save()
        assert (isinstance(ontology, Ontology))
        assert (ontology.name == name)

        ontology = Ontology().fetch(ontology.id)
        assert (isinstance(ontology, Ontology))
        assert (ontology.name == name)

        name = random_string()
        ontology.name = name
        ontology.update()
        assert (isinstance(ontology, Ontology))
        assert (ontology.name == name)

        ontology.delete()
        assert (not Ontology().fetch(ontology.id))
コード例 #14
0
    def test_abstract_image(self, connect, dataset):
        filename = random_string()
        abstract_image = AbstractImage(filename, "image/tiff").save()
        assert (isinstance(abstract_image, AbstractImage))
        assert (abstract_image.filename == filename)

        abstract_image = AbstractImage().fetch(abstract_image.id)
        assert (isinstance(abstract_image, AbstractImage))
        assert (abstract_image.filename == filename)
コード例 #15
0
    def test_imagegroup(self, connect, dataset):
        name = random_string()
        imagegroup = ImageGroup(name, dataset["project"].id).save()
        assert (isinstance(imagegroup, ImageGroup))
        assert (imagegroup.name == name)

        imagegroup = ImageGroup().fetch(imagegroup.id)
        assert (isinstance(imagegroup, ImageGroup))
        assert (imagegroup.name == name)

        name = random_string()
        imagegroup.name = name
        imagegroup.update()
        assert (isinstance(imagegroup, ImageGroup))
        assert (imagegroup.name == name)

        imagegroup.delete()
        assert (not ImageGroup().fetch(imagegroup.id))
コード例 #16
0
    def test_discipline(self, connect, dataset):
        name = random_string()
        discipline = Discipline(name).save()
        assert (isinstance(discipline, Discipline))
        assert (discipline.name == name)

        discipline = Discipline().fetch(discipline.id)
        assert (isinstance(discipline, Discipline))
        assert (discipline.name == name)

        name = random_string()
        discipline.name = name
        discipline.update()
        assert (isinstance(discipline, Discipline))
        assert (discipline.name == name)

        discipline.delete()
        assert (not Discipline().fetch(discipline.id))
コード例 #17
0
    def test_ontology(self, connect, dataset):
        name = random_string()
        ontology = Ontology(name).save()
        assert (isinstance(ontology, Ontology))
        assert (ontology.name == name)

        ontology = Ontology().fetch(ontology.id)
        assert (isinstance(ontology, Ontology))
        assert (ontology.name == name)

        name = random_string()
        ontology.name = name
        ontology.update()
        assert (isinstance(ontology, Ontology))
        assert (ontology.name == name)

        ontology.delete()
        assert (not Ontology().fetch(ontology.id))
コード例 #18
0
    def test_group(self, connect, dataset):
        name = random_string()
        group = Group(name, 100).save()
        assert (isinstance(group, Group))
        assert (group.name == name)

        group = Group().fetch(group.id)
        assert (isinstance(group, Group))
        assert (group.name == name)

        name = random_string()
        group.name = name
        group.update()
        assert (isinstance(group, Group))
        assert (group.name == name)

        group.delete()
        assert (not Group().fetch(group.id))
コード例 #19
0
    def test_softwares(self, connect, dataset):
        softwares = SoftwareCollection().fetch()
        assert (isinstance(softwares, SoftwareCollection))

        softwares = SoftwareCollection()
        softwares.append(
            Software(random_string(), "createRabbitJobWithArgsService",
                     "ValidateAnnotation"))
        assert (softwares.save())
コード例 #20
0
    def test_user(self, connect, dataset):
        name = random_string()
        user = User(name, random_string(), random_string(), "*****@*****.**", random_string()).save()
        assert(isinstance(user, User))
        assert(user.username == name)

        user = User().fetch(user.id)
        assert(isinstance(user, User))
        assert(user.username == name)

        name = random_string()
        user.username = name
        user.update()
        assert(isinstance(user, User))
        assert(user.username == name)

        user.delete()
        assert(not User().fetch(user.id))
コード例 #21
0
    def test_description(self, connect, dataset):
        data = random_string()
        description = Description(dataset["project"], data).save()
        assert (isinstance(description, Description))
        assert (description.data == data)

        description = Description(dataset["project"]).fetch(description.id)
        assert (isinstance(description, Description))
        assert (description.data == data)

        data = random_string()
        description.data = data
        description.update()
        assert (isinstance(description, Description))
        assert (description.data == data)

        description.delete()
        assert (not Description(dataset["project"]).fetch(description.id))
コード例 #22
0
    def test_group(self, connect, dataset):
        name = random_string()
        group = Group(name, 100).save()
        assert (isinstance(group, Group))
        assert (group.name == name)

        group = Group().fetch(group.id)
        assert (isinstance(group, Group))
        assert (group.name == name)

        name = random_string()
        group.name = name
        group.update()
        assert (isinstance(group, Group))
        assert (group.name == name)

        group.delete()
        assert (not Group().fetch(group.id))
コード例 #23
0
    def test_imagegroup(self, connect, dataset):
        name = random_string()
        imagegroup = ImageGroup(name, dataset["project"].id).save()
        assert (isinstance(imagegroup, ImageGroup))
        assert (imagegroup.name == name)

        imagegroup = ImageGroup().fetch(imagegroup.id)
        assert (isinstance(imagegroup, ImageGroup))
        assert (imagegroup.name == name)

        name = random_string()
        imagegroup.name = name
        imagegroup.update()
        assert (isinstance(imagegroup, ImageGroup))
        assert (imagegroup.name == name)

        imagegroup.delete()
        assert (not ImageGroup().fetch(imagegroup.id))
コード例 #24
0
    def test_term(self, connect, dataset):
        name = random_string()
        term = Term(name, dataset["ontology"].id, "#AAAAAA").save()
        assert (isinstance(term, Term))
        assert (term.name == name)

        term = Term().fetch(term.id)
        assert (isinstance(term, Term))
        assert (term.name == name)

        name = random_string()
        term.name = name
        term.update()
        assert (isinstance(term, Term))
        assert (term.name == name)

        term.delete()
        assert (not Term().fetch(term.id))
コード例 #25
0
    def test_project(self, connect, dataset):
        name = random_string()
        project = Project(name, dataset["ontology"].id).save()
        assert(isinstance(project, Project))
        assert(project.name == name)

        project = Project().fetch(project.id)
        assert(isinstance(project, Project))
        assert(project.name == name)

        name = random_string()
        project.name = name
        project.update()
        assert(isinstance(project, Project))
        assert(project.name == name)

        project.delete()
        assert(not Project().fetch(project.id))
コード例 #26
0
    def test_term(self, connect, dataset):
        name = random_string()
        term = Term(name, dataset["ontology"].id, "#AAAAAA").save()
        assert (isinstance(term, Term))
        assert (term.name == name)

        term = Term().fetch(term.id)
        assert (isinstance(term, Term))
        assert (term.name == name)

        name = random_string()
        term.name = name
        term.update()
        assert (isinstance(term, Term))
        assert (term.name == name)

        term.delete()
        assert (not Term().fetch(term.id))
コード例 #27
0
    def test_discipline(self, connect, dataset):
        name = random_string()
        discipline = Discipline(name).save()
        assert (isinstance(discipline, Discipline))
        assert (discipline.name == name)

        discipline = Discipline().fetch(discipline.id)
        assert (isinstance(discipline, Discipline))
        assert (discipline.name == name)

        name = random_string()
        discipline.name = name
        discipline.update()
        assert (isinstance(discipline, Discipline))
        assert (discipline.name == name)

        discipline.delete()
        assert (not Discipline().fetch(discipline.id))
コード例 #28
0
    def test_project(self, connect, dataset):
        name = random_string()
        project = Project(name, dataset["ontology"].id).save()
        assert(isinstance(project, Project))
        assert(project.name == name)

        project = Project().fetch(project.id)
        assert(isinstance(project, Project))
        assert(project.name == name)

        name = random_string()
        project.name = name
        project.update()
        assert(isinstance(project, Project))
        assert(project.name == name)

        project.delete()
        assert(not Project().fetch(project.id))
コード例 #29
0
    def test_software(self, connect, dataset):
        name = random_string()
        software = Software(name, "createRabbitJobWithArgsService", "ValidateAnnotation").save()
        assert (isinstance(software, Software))
        assert (software.name == name)

        software = Software().fetch(software.id)
        assert (isinstance(software, Software))
        assert (software.name == name)

        name = random_string()
        software.name = name
        software.update()
        assert (isinstance(software, Software))
        assert (software.name == name)

        software.delete()
        assert (not Software().fetch(software.id))
コード例 #30
0
    def test_software(self, connect, dataset):
        name = random_string()
        software = Software(name, "createRabbitJobWithArgsService",
                            "ValidateAnnotation").save()
        assert (isinstance(software, Software))
        assert (software.name == name)

        software = Software().fetch(software.id)
        assert (isinstance(software, Software))
        assert (software.name == name)

        name = random_string()
        software.name = name
        software.update()
        assert (isinstance(software, Software))
        assert (software.name == name)

        software.delete()
        assert (not Software().fetch(software.id))
コード例 #31
0
    def test_user(self, connect, dataset):
        name = random_string()
        user = User(name, random_string(), random_string(), "*****@*****.**",
                    random_string()).save()
        assert (isinstance(user, User))
        assert (user.username == name)

        user = User().fetch(user.id)
        assert (isinstance(user, User))
        assert (user.username == name)

        name = random_string()
        user.username = name
        user.update()
        assert (isinstance(user, User))
        assert (user.username == name)

        user.delete()
        assert (not User().fetch(user.id))
コード例 #32
0
    def test_tag(self, connect, dataset):
        name = random_string()
        tag = Tag(name).save()
        assert (isinstance(tag, Tag))
        assert (tag.name == name)

        tag = Tag().fetch(tag.id)
        assert (isinstance(tag, Tag))
        assert (tag.name == name)

        name = random_string()
        tag.name = name
        tag.update()
        assert (isinstance(tag, Tag))
        assert (tag.name == name)

        tag.delete()
        assert (not Tag().fetch(tag.id))

        tag = Tag().save()
        assert (tag == False)
コード例 #33
0
    def test_property(self, connect, dataset):
        value = random_string()
        property = Property(dataset["project"], "key", value).save()
        assert (isinstance(property, Property))
        assert (property.value == value)

        property = Property(dataset["project"]).fetch(property.id)
        assert (isinstance(property, Property))
        assert (property.value == value)

        property = Property(dataset["project"]).fetch(key="key")
        assert (isinstance(property, Property))
        assert (property.value == value)

        value = random_string()
        property.value = value
        property.update()
        assert (isinstance(property, Property))
        assert (property.value == value)

        property.delete()
        assert (not Property(dataset["project"]).fetch(property.id))
コード例 #34
0
    def test_software_parameter(self, connect, dataset):
        name = random_string()
        sp = SoftwareParameter(name, "Number", dataset["software"].id, 0, False, 100, False).save()
        assert (isinstance(sp, SoftwareParameter))
        assert (sp.name == name)

        sp = SoftwareParameter().fetch(sp.id)
        assert (isinstance(sp, SoftwareParameter))
        assert (sp.name == name)

        name = name + "bis"
        sp.name = name
        sp.update()
        assert (isinstance(sp, SoftwareParameter))
        assert (sp.name == name)

        sp.delete()
        assert (not SoftwareParameter().fetch(sp.id))
コード例 #35
0
    def test_software_parameter(self, connect, dataset):
        name = random_string()
        sp = SoftwareParameter(name, "Number", dataset["software"].id, 0,
                               False, 100, False).save()
        assert (isinstance(sp, SoftwareParameter))
        assert (sp.name == name)

        sp = SoftwareParameter().fetch(sp.id)
        assert (isinstance(sp, SoftwareParameter))
        assert (sp.name == name)

        name = name + "bis"
        sp.name = name
        sp.update()
        assert (isinstance(sp, SoftwareParameter))
        assert (sp.name == name)

        sp.delete()
        assert (not SoftwareParameter().fetch(sp.id))
コード例 #36
0
 def test_abstract_image(self, connect, dataset):
     filename = random_string()
     abstract_image = AbstractImage(filename, "image/tiff").save()
     assert (isinstance(abstract_image, AbstractImage))
     assert (abstract_image.filename == filename)
コード例 #37
0
 def test_software_parameters(self, connect, dataset):
     sps = SoftwareParameterCollection()
     sps.append(SoftwareParameter(random_string(), "Number", dataset["software"].id, 0, False, 100, False))
     assert (sps.save())
コード例 #38
0
 def test_software_parameters(self, connect, dataset):
     sps = SoftwareParameterCollection()
     sps.append(
         SoftwareParameter(random_string(), "Number",
                           dataset["software"].id, 0, False, 100, False))
     assert (sps.save())
コード例 #39
0
 def test_imagegroups(self, connect, dataset):
     imagegroups = ImageGroupCollection()
     imagegroups.append(ImageGroup(random_string(), dataset["project"].id))
     assert (imagegroups.save())
コード例 #40
0
 def test_imagegroups(self, connect, dataset):
     imagegroups = ImageGroupCollection()
     imagegroups.append(ImageGroup(random_string(), dataset["project"].id))
     assert (imagegroups.save())