Пример #1
0
    def test_marshal_plate_acquisition_not_owner(self, mock_conn,
                                                 owner_permissions):
        row = [rlong(1L), None, rlong(2L), owner_permissions, None, None]
        expected = {
            'id': 1L,
            'ownerId': 2L,
            'name': 'Run 1',
            'permsCss': 'canEdit canAnnotate canLink canDelete'
        }

        marshaled = _marshal_plate_acquisition(mock_conn, row)
        assert marshaled == expected
Пример #2
0
    def test_marshal_plate_acquisition_not_owner(self, mock_conn,
                                                 owner_permissions):
        row = [rlong(1), None, rlong(2), owner_permissions, None, None]
        expected = {
            "id": 1,
            "ownerId": 2,
            "name": "Run 1",
            "permsCss": "canEdit canAnnotate canLink canDelete canChgrp",
        }

        marshaled = _marshal_plate_acquisition(mock_conn, row)
        assert marshaled == expected
Пример #3
0
    def test_marshal_plate_acquisition_no_name_no_start_no_end(
            self, mock_conn, owner_permissions):
        row = [rlong(1), None, rlong(1), owner_permissions, None, None]
        expected = {
            'id': 1,
            'ownerId': 1,
            'name': 'Run 1',
            'permsCss':
            'canEdit canAnnotate canLink canDelete canChgrp isOwned'
        }

        marshaled = _marshal_plate_acquisition(mock_conn, row)
        assert marshaled == expected
Пример #4
0
    def test_marshal_plate_acquisition_no_name_start_end(
            self, mock_conn, owner_permissions, start_time, end_time):
        row = [
            rlong(1), None,
            rlong(1), owner_permissions, start_time, end_time
        ]
        expected = {
            "id": 1,
            "ownerId": 1,
            "name": "2014-05-08 10:37:02 - 2014-05-08 10:38:30",
            "permsCss":
            "canEdit canAnnotate canLink canDelete canChgrp isOwned",
        }

        marshaled = _marshal_plate_acquisition(mock_conn, row)
        assert marshaled == expected
Пример #5
0
    def test_marshal_plate_acquisition_no_name_start_end(
            self, mock_conn, owner_permissions, start_time, end_time):
        row = [
            rlong(1L), None,
            rlong(1L), owner_permissions, start_time, end_time
        ]
        expected = {
            'id': 1L,
            'ownerId': 1L,
            'name': '2014-05-08 10:37:02 - 2014-05-08 10:38:30',
            'permsCss':
            'canEdit canAnnotate canLink canDelete isOwned canChgrp'
        }

        marshaled = _marshal_plate_acquisition(mock_conn, row)
        assert marshaled == expected
Пример #6
0
    def test_marshal_plate_acquisition_name_no_start_no_end(
            self, mock_conn, owner_permissions):
        row = [
            rlong(1),
            rstring("name"),
            rlong(1), owner_permissions, None, None
        ]
        expected = {
            "id": 1,
            "ownerId": 1,
            "name": "name",
            "permsCss":
            "canEdit canAnnotate canLink canDelete canChgrp isOwned",
        }

        marshaled = _marshal_plate_acquisition(mock_conn, row)
        assert marshaled == expected
Пример #7
0
    def test_marshal_plate_acquisition_not_owner(self, mock_conn, owner_permissions):
        row = [rlong(1L), None, rlong(2L), owner_permissions, None, None]
        expected = {"id": 1L, "ownerId": 2L, "name": "Run 1", "permsCss": "canEdit canAnnotate canLink canDelete"}

        marshaled = _marshal_plate_acquisition(mock_conn, row)
        assert marshaled == expected
Пример #8
0
      * details.owner.id (rlong)
      * details.permissions (dict)
      * startTime (rtime)
      * endTime (rtime)
    """

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

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

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

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

    def test_marshal_plate_acquisition_no_name_start_end(self, mock_conn, owner_permissions, start_time, end_time):