Exemple #1
0
 def test_bad_settings(self, settings, menu):
     assert menu not in settings.MAPR_CONFIG.keys()
     with pytest.raises(NoReverseMatch) as excinfo:
         request_url = reverse("maprindex_%s" % menu)
         _get_response(self.django_client, request_url, {}, status_code=200)
     regx = r"Reverse for 'maprindex_%s'.*" % menu
     assert excinfo.match(regx)
    def test_nsbulkannotations_file(self, bulkann):
        if bulkann:
            ns = NSBULKANNOTATIONS
        else:
            ns = 'other'
        # Create plate
        p = omero.model.PlateI()
        p.setName(wrap(self.uuid()))
        update = self.client.sf.getUpdateService()
        p = update.saveAndReturnObject(p)

        # Create a file annotation
        name = self.uuid()
        fa = self.make_file_annotation(name=name, namespace=ns)
        link = self.link(p, fa)

        # retrieve annotations
        request_url = reverse("webgateway_annotations",
                              args=["Plate", p.id.val])
        rsp = _get_response(self.django_client,
                            request_url, {},
                            status_code=200)
        j = json.loads(rsp.content)

        if bulkann:
            assert len(j["data"]) == 1
            assert j["data"][0]["file"] == link.child.file.id.val
        else:
            assert len(j["data"]) == 0
    def test_nsbulkannotations_not_file(self):
        # Create plate
        p = omero.model.PlateI()
        p.setName(wrap(self.uuid()))
        update = self.client.sf.getUpdateService()
        p = update.saveAndReturnObject(p)

        # Create a non-file annotation
        tag = self.new_tag(ns=NSBULKANNOTATIONS)
        link = self.link(p, tag)
        assert link

        # retrieve annotations
        request_url = reverse("webgateway_annotations",
                              args=["Plate", p.id.val])
        rsp = _get_response(self.django_client,
                            request_url, {},
                            status_code=200)
        j = json.loads(rsp.content)
        assert len(j["data"]) == 0
Exemple #4
0
 def test_settings(self, settings):
     assert len(settings.MAPR_CONFIG.keys()) > 0
     for menu in settings.MAPR_CONFIG.keys():
         request_url = reverse("maprindex_%s" % menu)
         _get_response(self.django_client, request_url, {}, status_code=200)