예제 #1
0
    def test_tag_redirect(self, tag_path_request):
        show = Show(conn, tag_path_request['request'], None)
        self.assert_instantiation(show, tag_path_request, conn)

        with pytest.raises(IncorrectMenuError) as excinfo:
            show.first_selected
        assert excinfo.value.uri is not None
예제 #2
0
    def test_screen_plate_run_well_by_name(
            self, conn, screen_plate_run_well_by_name_path_request,
            screen_plate_run_well):
        show = Show(conn,
                    screen_plate_run_well_by_name_path_request['request'],
                    None)
        self.assert_instantiation(show,
                                  screen_plate_run_well_by_name_path_request,
                                  conn)

        plate, = screen_plate_run_well.linkedPlateList()
        well_a, well_b = \
            sorted(plate.copyWells(), cmp_well_column)
        ws_a, ws_b = well_a.copyWellSamples()
        plate_acquisition = ws_a.plateAcquisition
        first_selected = show.first_selected
        assert first_selected is not None
        assert isinstance(first_selected, PlateAcquisitionWrapper)
        assert first_selected.getId() == plate_acquisition.id.val
        assert show.initially_open == \
            screen_plate_run_well_by_name_path_request['initially_open']
        assert show.initially_open_owner == \
            plate_acquisition.details.owner.id.val
        assert show._first_selected == first_selected
        assert show.initially_select == \
            screen_plate_run_well_by_name_path_request['initially_select']
예제 #3
0
    def test_project_legacy_path(self, conn, project_path_request, project):
        show = Show(conn, project_path_request['request'], None)
        self.assert_instantiation(show, project_path_request, conn)

        first_selected = show.first_selected
        assert first_selected is not None
        assert isinstance(first_selected, ProjectWrapper)
        assert first_selected.getId() == project.id.val
        assert show.initially_open == project_path_request['initially_open']
        assert show.initially_open_owner == project.details.owner.id.val
        assert show._first_selected == first_selected
        assert show.initially_select == \
            project_path_request['initially_select']
예제 #4
0
    def test_screen_plate_run_illegal_run(self, conn,
                                          screen_plate_run_illegal_run_request,
                                          screen_plate_run_well):
        show = Show(conn, screen_plate_run_illegal_run_request['request'],
                    None)
        self.assert_instantiation(show, screen_plate_run_illegal_run_request,
                                  conn)

        first_selected = show.first_selected
        assert first_selected is None
        assert show.initially_open is None
        assert show.initially_select == \
            screen_plate_run_illegal_run_request['initially_select']
예제 #5
0
    def test_tag_legacy_path(self, conn, tag_path_request, tag):
        show = Show(conn, tag_path_request['request'], 'usertags')
        self.assert_instantiation(show, tag_path_request, conn)

        first_selected = show.first_selected
        assert first_selected is not None
        assert isinstance(first_selected, TagAnnotationWrapper)
        assert first_selected.getId() == tag.id.val
        assert show.initially_open == \
            tag_path_request['initially_open']
        assert show.initially_open_owner == \
            tag.details.owner.id.val
        assert show._first_selected == first_selected
        assert show.initially_select == tag_path_request['initially_select']
예제 #6
0
    def test_tag_by_value(self, conn, tag_by_textvalue_path_request, tag):
        show = Show(conn, tag_by_textvalue_path_request['request'], 'usertags')
        self.assert_instantiation(show, tag_by_textvalue_path_request, conn)

        first_selected = show.first_selected
        assert first_selected is not None
        assert isinstance(first_selected, TagAnnotationWrapper)
        assert first_selected.getValue() == tag.textValue.val
        assert len(show.initially_open) == \
            len(tag_by_textvalue_path_request['initially_open'])
        assert show.initially_open_owner == \
            tag.details.owner.id.val
        assert show._first_selected == first_selected
        assert len(show.initially_select) == \
            len(tag_by_textvalue_path_request['initially_select'])
예제 #7
0
    def test_well_by_name(self, conn, well_by_name_path_request,
                          screen_plate_well):
        show = Show(conn, well_by_name_path_request['request'], 'usertags')
        self.assert_instantiation(show, well_by_name_path_request, conn)

        plate, = screen_plate_well.linkedPlateList()
        first_selected = show.first_selected
        assert first_selected is not None
        assert isinstance(first_selected, PlateWrapper)
        assert first_selected.getId() == plate.id.val
        assert show.initially_open == \
            well_by_name_path_request['initially_open']
        assert show.initially_open_owner == \
            plate.details.owner.id.val
        assert show._first_selected == first_selected
        assert show.initially_select == \
            well_by_name_path_request['initially_select']
예제 #8
0
    def test_screen_plate_legacy_path(self, conn, screen_plate_path_request,
                                      screen_plate):
        show = Show(conn, screen_plate_path_request['request'], None)
        self.assert_instantiation(show, screen_plate_path_request, conn)

        plate, = screen_plate.linkedPlateList()
        first_selected = show.first_selected
        assert first_selected is not None
        assert isinstance(first_selected, PlateWrapper)
        assert first_selected.getId() == plate.id.val
        assert show.initially_open == \
            screen_plate_path_request['initially_open']
        assert show.initially_open_owner == \
            screen_plate.details.owner.id.val
        assert show._first_selected == first_selected
        assert show.initially_select == \
            screen_plate_path_request['initially_select']
예제 #9
0
    def test_project_dataset_image_show(self, conn,
                                        project_dataset_image_show_request,
                                        project_dataset_image):
        show = Show(conn, project_dataset_image_show_request['request'], None)
        self.assert_instantiation(show, project_dataset_image_show_request,
                                  conn)

        dataset, = project_dataset_image.linkedDatasetList()
        image, = dataset.linkedImageList()
        first_selected = show.first_selected
        assert first_selected is not None
        assert isinstance(first_selected, ImageWrapper)
        assert first_selected.getId() == image.id.val
        assert show.initially_open == \
            project_dataset_image_show_request['initially_open']
        assert show.initially_open_owner == \
            project_dataset_image.details.owner.id.val
        assert show._first_selected == first_selected
        assert show.initially_select == \
            project_dataset_image_show_request['initially_select']
예제 #10
0
 def test_legacy_path_instantiation(self, path_request):
     show = Show(None, path_request['request'], None)
     assert len(show.initially_open) == 0
     assert show.initially_open_owner is None
     assert show.initially_select == list(path_request['initially_select'])
     assert show._first_selected is None
예제 #11
0
 def test_basic_instantiation(self, empty_request):
     show = Show(None, empty_request, None)
     assert len(show.initially_open) == 0
     assert show.initially_open_owner is None
     assert show.initially_select == list()
     assert show._first_selected is None
예제 #12
0
 def test_show_instantiation(self, show_request):
     show = Show(None, show_request["request"], None)
     assert len(show.initially_open) == 0
     assert show.initially_open_owner is None
     assert show.initially_select == list(show_request["initially_select"])
     assert show._first_selected is None
예제 #13
0
 def test_empty_path(self, empty_request):
     show = Show(conn, empty_request['request'], None)
     self.assert_instantiation(show, empty_request, conn)
     first_selected = show.first_selected
     assert first_selected is None
예제 #14
0
 def test_show_instantiation(self, show_request):
     show = Show(None, show_request['request'], None)
     assert show.initially_open is None
     assert show.initially_open_owner is None
     assert show.initially_select == list(show_request['initially_select'])
     assert show._first_selected is None