示例#1
0
def test_generate_deportee_properties_2():
    properties_data = "bad"
    output = export.generate_deportee_properties(properties_data)
    expected = {}
    assert output == expected
示例#2
0
def test_generate_deportee_properties_2():
    properties_data = "bad"
    output = export.generate_deportee_properties(properties_data)
    expected = {}
    assert output == expected
示例#3
0
def test_generate_deportee_properties():
    properties_data = [{'gsx$marriagestatus': {'$t': 'Single'}, 'gsx$citizenship': {'$t': 'China'}, 'gsx$documentrefernce': {'$t': 'Yuen Chung - 17; DSCN7735.JPG'}, 'gsx$justificationforremovalsecondary': {'$t': ''}, 'gsx$ethnicity': {'$t': 'Chinese'}, 'link': [{'href': 'https://spreadsheets.google.com/feeds/list/1DdH4tBFFRlbk4kZ_oik6-M7jUJIrC1UtqYOs2yVy9-s/1/public/full/hps2g', 'rel': 'self', 'type': 'application/atom+xml'}], 'title': {'type': 'text', '$t': 'Yuen Chung'}, 'gsx$occupation3': {'$t': ''}, 'gsx$occupation2': {'$t': ''}, 'gsx$notesdocument': {'$t': ''}, 'gsx$casefilenumber': {'$t': '53855/23'}, 'gsx$justificationforremovalprimary': {'$t': 'Violation of Chinese Exclusion Act'}, 'content': {'type': 'text', '$t': 'uniqueid: 131, trainid: Eastbound January 1915, citizenship: China, ethnicity: Chinese, sex: M, birthyear: 1876, occupation1: Laborer, marriagestatus: Single, travelingwithchildrennumber: N, literate: N, justificationforremovalprimary: Violation of Chinese Exclusion Act, documentrefernce: Yuen Chung - 17; DSCN7735.JPG, aliasesothernames: Foh Ying, Yuen Hoy Yick, casefilenumber: 53855/23'}, 'gsx$sex': {'$t': 'M'}, 'gsx$name': {'$t': 'Yuen Chung'}, 'gsx$occupation1': {'$t': 'Laborer'}, 'gsx$birthyear': {'$t': '1876'}, 'gsx$birthmonth': {'$t': ''}, 'id': {'$t': 'https://spreadsheets.google.com/feeds/list/1DdH4tBFFRlbk4kZ_oik6-M7jUJIrC1UtqYOs2yVy9-s/1/public/full/hps2g'}, 'gsx$travelingwithchildrennumber': {'$t': 'N'}, 'gsx$literate': {'$t': 'N'}, 'gsx$uniqueid': {'$t': '131'}, 'gsx$justificationforremovaltertiary': {'$t': ''}, 'updated': {'$t': '2016-10-15T09:36:23.768Z'}, 'gsx$trainid': {'$t': 'Eastbound January 1915'}, 'gsx$birthdate': {'$t': ''}, 'gsx$aliasesothernames': {'$t': 'Foh Ying, Yuen Hoy Yick'}, 'category': [{'term': 'http://schemas.google.com/spreadsheets/2006#list', 'scheme': 'http://schemas.google.com/spreadsheets/2006'}]}]
    output = export.generate_deportee_properties(properties_data)
    expected = {'citizenship': 'China', 'travelingwithchildrennumber': 'N', 'literate': 'N', 'name': 'Yuen Chung', 'uniqueid': '131', 'justificationforremovalsecondary': '', 'occupation2': '', 'birthmonth': '', 'birthyear': '1876', 'sex': 'M', 'casefilenumber': '53855/23', 'documentrefernce': 'Yuen Chung - 17; DSCN7735.JPG', 'notesdocument': '', 'occupation1': 'Laborer', 'ethnicity': 'Chinese', 'trainid': 'Eastbound January 1915', 'marriagestatus': 'Single', 'aliasesothernames': 'Foh Ying, Yuen Hoy Yick', 'occupation3': '', 'justificationforremovalprimary': 'Violation of Chinese Exclusion Act', 'birthdate': '', 'justificationforremovaltertiary': ''}
    assert output == expected
示例#4
0
def test_generate_deportee_properties():
    properties_data = [{
        'gsx$marriagestatus': {
            '$t': 'Single'
        },
        'gsx$citizenship': {
            '$t': 'China'
        },
        'gsx$documentrefernce': {
            '$t': 'Yuen Chung - 17; DSCN7735.JPG'
        },
        'gsx$justificationforremovalsecondary': {
            '$t': ''
        },
        'gsx$ethnicity': {
            '$t': 'Chinese'
        },
        'link': [{
            'href':
            'https://spreadsheets.google.com/feeds/list/1DdH4tBFFRlbk4kZ_oik6-M7jUJIrC1UtqYOs2yVy9-s/1/public/full/hps2g',
            'rel': 'self',
            'type': 'application/atom+xml'
        }],
        'title': {
            'type': 'text',
            '$t': 'Yuen Chung'
        },
        'gsx$occupation3': {
            '$t': ''
        },
        'gsx$occupation2': {
            '$t': ''
        },
        'gsx$notesdocument': {
            '$t': ''
        },
        'gsx$casefilenumber': {
            '$t': '53855/23'
        },
        'gsx$justificationforremovalprimary': {
            '$t': 'Violation of Chinese Exclusion Act'
        },
        'content': {
            'type':
            'text',
            '$t':
            'uniqueid: 131, trainid: Eastbound January 1915, citizenship: China, ethnicity: Chinese, sex: M, birthyear: 1876, occupation1: Laborer, marriagestatus: Single, travelingwithchildrennumber: N, literate: N, justificationforremovalprimary: Violation of Chinese Exclusion Act, documentrefernce: Yuen Chung - 17; DSCN7735.JPG, aliasesothernames: Foh Ying, Yuen Hoy Yick, casefilenumber: 53855/23'
        },
        'gsx$sex': {
            '$t': 'M'
        },
        'gsx$name': {
            '$t': 'Yuen Chung'
        },
        'gsx$occupation1': {
            '$t': 'Laborer'
        },
        'gsx$birthyear': {
            '$t': '1876'
        },
        'gsx$birthmonth': {
            '$t': ''
        },
        'id': {
            '$t':
            'https://spreadsheets.google.com/feeds/list/1DdH4tBFFRlbk4kZ_oik6-M7jUJIrC1UtqYOs2yVy9-s/1/public/full/hps2g'
        },
        'gsx$travelingwithchildrennumber': {
            '$t': 'N'
        },
        'gsx$literate': {
            '$t': 'N'
        },
        'gsx$uniqueid': {
            '$t': '131'
        },
        'gsx$justificationforremovaltertiary': {
            '$t': ''
        },
        'updated': {
            '$t': '2016-10-15T09:36:23.768Z'
        },
        'gsx$trainid': {
            '$t': 'Eastbound January 1915'
        },
        'gsx$birthdate': {
            '$t': ''
        },
        'gsx$aliasesothernames': {
            '$t': 'Foh Ying, Yuen Hoy Yick'
        },
        'category': [{
            'term': 'http://schemas.google.com/spreadsheets/2006#list',
            'scheme': 'http://schemas.google.com/spreadsheets/2006'
        }]
    }]
    output = export.generate_deportee_properties(properties_data)
    expected = {
        'citizenship': 'China',
        'travelingwithchildrennumber': 'N',
        'literate': 'N',
        'name': 'Yuen Chung',
        'uniqueid': '131',
        'justificationforremovalsecondary': '',
        'occupation2': '',
        'birthmonth': '',
        'birthyear': '1876',
        'sex': 'M',
        'casefilenumber': '53855/23',
        'documentrefernce': 'Yuen Chung - 17; DSCN7735.JPG',
        'notesdocument': '',
        'occupation1': 'Laborer',
        'ethnicity': 'Chinese',
        'trainid': 'Eastbound January 1915',
        'marriagestatus': 'Single',
        'aliasesothernames': 'Foh Ying, Yuen Hoy Yick',
        'occupation3': '',
        'justificationforremovalprimary': 'Violation of Chinese Exclusion Act',
        'birthdate': '',
        'justificationforremovaltertiary': ''
    }
    assert output == expected