示例#1
0
    def test_artifact_get_prep_req(self):
        obs = artifact_get_prep_req('*****@*****.**', [4])
        exp = {
            'status': 'success',
            'msg': '',
            'data': {
                4: [
                    '1.SKB1.640202', '1.SKB2.640194', '1.SKB3.640195',
                    '1.SKB4.640189', '1.SKB5.640181', '1.SKB6.640176',
                    '1.SKB7.640196', '1.SKB8.640193', '1.SKB9.640200',
                    '1.SKD1.640179', '1.SKD2.640178', '1.SKD3.640198',
                    '1.SKD4.640185', '1.SKD5.640186', '1.SKD6.640190',
                    '1.SKD7.640191', '1.SKD8.640184', '1.SKD9.640182',
                    '1.SKM1.640183', '1.SKM2.640199', '1.SKM3.640197',
                    '1.SKM4.640180', '1.SKM5.640177', '1.SKM6.640187',
                    '1.SKM7.640188', '1.SKM8.640201', '1.SKM9.640192'
                ]
            }
        }
        self.assertEqual(obs, exp)

        obs = artifact_get_prep_req('*****@*****.**', [4])
        exp = {
            'status': 'error',
            'message': 'User does not have access to study'
        }
        self.assertEqual(obs, exp)
示例#2
0
    def test_artifact_get_prep_req(self):
        obs = artifact_get_prep_req('*****@*****.**', [4])
        exp = {'status': 'success', 'msg': '', 'data': {
            4: ['1.SKB2.640194', '1.SKM4.640180', '1.SKB3.640195',
                '1.SKB6.640176', '1.SKD6.640190', '1.SKM6.640187',
                '1.SKD9.640182', '1.SKM8.640201', '1.SKM2.640199',
                '1.SKD2.640178', '1.SKB7.640196', '1.SKD4.640185',
                '1.SKB8.640193', '1.SKM3.640197', '1.SKD5.640186',
                '1.SKB1.640202', '1.SKM1.640183', '1.SKD1.640179',
                '1.SKD3.640198', '1.SKB5.640181', '1.SKB4.640189',
                '1.SKB9.640200', '1.SKM9.640192', '1.SKD8.640184',
                '1.SKM5.640177', '1.SKM7.640188', '1.SKD7.640191']}}
        self.assertEqual(obs, exp)

        obs = artifact_get_prep_req('*****@*****.**', [4])
        exp = {'status': 'error',
               'message': 'User does not have access to study'}
        self.assertEqual(obs, exp)