def test_row2dict(): hmap = header_map(table[0]) assert row2dict(hmap, table[1]) == { 'name': 'Bob', 'age': '5', 'eye colour': 'blue' }
def test_row2dict2(): hmap = header_map(table2[0]) assert row2dict(hmap, table2[1]) == { 'house': 'Atreides', 'origin': 'Atreus', 'color': 'green', 'enemy': 'Harkonnen' }
def test_header_map_4(): hmap = header_map(table3) assert hmap == {}
def test_header_map_3(): ''' Make a non header row to be the header ''' hmap = header_map(table2[1]) assert hmap == {'Atreides': 0, 'Atreus': 1, 'Harkonnen': 3, 'green': 2}
def test_header_map_2(): hmap = header_map(table2[0]) assert hmap == {'house': 0, 'origin': 1, 'color': 2, 'enemy': 3}
def test_header_map_1(): hmap = header_map(table[0]) assert hmap == {'name': 0, 'age': 1, 'eye colour': 2}