Exemple #1
0
    def test_marshal_dataset_not_owner(self, mock_conn, owner_permissions):
        row = [
            rlong(1L),
            rstring('name'),
            rlong(2L), owner_permissions,
            rlong(1L)
        ]
        expected = {
            'id': 1L,
            'ownerId': 2L,
            'name': 'name',
            'permsCss': 'canEdit canAnnotate canLink canDelete',
            'childCount': 1
        }

        marshaled = _marshal_dataset(mock_conn, row)
        assert marshaled == expected
Exemple #2
0
    def test_marshal_dataset_not_owner(self, mock_conn, owner_permissions):
        row = [
            rlong(1),
            rstring("name"),
            rlong(2), owner_permissions,
            rlong(1)
        ]
        expected = {
            "id": 1,
            "ownerId": 2,
            "name": "name",
            "permsCss": "canEdit canAnnotate canLink canDelete canChgrp",
            "childCount": 1,
        }

        marshaled = _marshal_dataset(mock_conn, row)
        assert marshaled == expected
Exemple #3
0
            received = parse_permissions_css(permissions_dict, owner_id, mock_conn)
            received = filter(None, received.split(" "))
            received.sort()
            assert expected == received

    def test_marshal_dataset(self, mock_conn, owner_permissions):
        row = [rlong(1L), rstring("name"), rlong(1L), owner_permissions, rlong(1L)]
        expected = {
            "id": 1L,
            "ownerId": 1L,
            "name": "name",
            "permsCss": "canEdit canAnnotate canLink canDelete isOwned canChgrp",
            "childCount": 1,
        }

        marshaled = _marshal_dataset(mock_conn, row)
        assert marshaled == expected

    def test_marshal_dataset_not_owner(self, mock_conn, owner_permissions):
        row = [rlong(1L), rstring("name"), rlong(2L), owner_permissions, rlong(1L)]
        expected = {
            "id": 1L,
            "ownerId": 2L,
            "name": "name",
            "permsCss": "canEdit canAnnotate canLink canDelete",
            "childCount": 1,
        }

        marshaled = _marshal_dataset(mock_conn, row)
        assert marshaled == expected