Example #1
0
    def test_marshal_datasets_different_users_as_other_user(
            self, datasets_different_users):
        dataset_a, dataset_b = datasets_different_users
        expected = list()
        perms_css = ''
        # The underlying query explicitly orders the Screens list by
        # case-insensitive name.
        for dataset in sorted(datasets_different_users, cmp_name_insensitive):
            expected.append({
                'id': dataset.id.val,
                'name': dataset.name.val,
                'childCount': 0L,
                'permsCss': perms_css,
            })

        self.conn.SERVICE_OPTS.setOmeroGroup(dataset_a.details.group.id.val)
        marshaled = marshal_datasets(self.conn, None)
        assert marshaled == expected
Example #2
0
 def test_marshal_datasets_no_results(self):
     assert marshal_datasets(self.conn, -1L) == []
Example #3
0
            'name': 'atom',
            'childCount': 0L,
            'permsCss': perms_css
        }, {
            'id': dataset_b.id.val,
            'name': 'bat',
            'childCount': 0L,
            'permsCss': perms_css
        }, {
            'id': dataset_d.id.val,
            'name': 'Butter',
            'childCount': 0L,
            'permsCss': perms_css
        }]

        marshaled = marshal_datasets(self.conn, self.conn.getUserId())
        assert marshaled == expected

    def test_marshal_datasets_different_users_as_other_user(
            self, datasets_different_users):
        dataset_a, dataset_b = datasets_different_users
        expected = list()
        perms_css = ''
        # The underlying query explicitly orders the Screens list by
        # case-insensitive name.
        for dataset in sorted(datasets_different_users, cmp_name_insensitive):
            expected.append({
                'id': dataset.id.val,
                'name': dataset.name.val,
                'childCount': 0L,
                'permsCss': perms_css,
Example #4
0
            'permsCss': perms_css
        }, {
            'id': dataset_b.id.val,
            'isOwned': True,
            'name': 'bat',
            'childCount': 0L,
            'permsCss': perms_css
        }, {
            'id': dataset_d.id.val,
            'isOwned': True,
            'name': 'Butter',
            'childCount': 0L,
            'permsCss': perms_css
        }]

        marshaled = marshal_datasets(conn, conn.getUserId())
        assert marshaled == expected

    def test_marshal_datasets_different_users_as_other_user(
            self, conn, datasets_different_users):
        dataset_a, dataset_b = datasets_different_users
        expected = list()
        perms_css = ''
        # The underlying query explicitly orders the Screens list by
        # case-insensitive name.
        for dataset in sorted(datasets_different_users, cmp_name_insensitive):
            expected.append({
                'id': dataset.id.val,
                'isOwned': False,
                'name': dataset.name.val,
                'childCount': 0L,