def test_16f_general(self):
     w = deepcopy(wrapper)
     
     rules.rule13b_publisher(w)
     rules.rule16e_general(w)
     
     # print rules.columns_added_by_cleanup
     assert len(rules.columns_added_by_cleanup) == 4
     
     rules.rule16f_general(w)
     
     assert not w.csv_dict.has_key("note.dc.publisher[en]")
     assert not w.csv_dict.has_key("manual.dc.publisher[en].is_not_person_name")
     assert not w.csv_dict.has_key("note.organisations")
     assert not w.csv_dict.has_key('manual.organisations.add_to_publisher')
    def test_16f_general(self):
        w = deepcopy(wrapper)

        rules.rule13b_publisher(w)
        rules.rule16e_general(w)

        # print rules.columns_added_by_cleanup
        assert len(rules.columns_added_by_cleanup) == 4

        rules.rule16f_general(w)

        assert not w.csv_dict.has_key("note.dc.publisher[en]")
        assert not w.csv_dict.has_key(
            "manual.dc.publisher[en].is_not_person_name")
        assert not w.csv_dict.has_key("note.organisations")
        assert not w.csv_dict.has_key('manual.organisations.add_to_publisher')
 def test_16e_general(self):
     w = deepcopy(wrapper)
     
     w.delete_column('note.organisations')
     w.delete_column('manual.organisations.add_to_publisher')
     
     rules.rule16e_general(w)
     
     assert w.csv_dict.has_key('note.organisations')
     assert w.csv_dict.has_key('manual.organisations.add_to_publisher')
     
     assert w.csv_dict['note.organisations'][1][0] == 'Leeds Metropolitan University'
     assert w.csv_dict['note.organisations'][2][0] == 'University of York'
     assert len(w.csv_dict['note.organisations'][2]) == 1
     assert 'Mark Foss ORG:University of Nottingham EMAIL:[email protected] END:vcard' in w.csv_dict['note.organisations'][5]
     assert 'Aberystwyth University' in w.csv_dict['note.organisations'][5]
     assert 'Archmage College' not in w.csv_dict['note.organisations'][6]
     assert 'Fairy College' in w.csv_dict['note.organisations'][6]
    def test_16e_general(self):
        w = deepcopy(wrapper)

        w.delete_column('note.organisations')
        w.delete_column('manual.organisations.add_to_publisher')

        rules.rule16e_general(w)

        assert w.csv_dict.has_key('note.organisations')
        assert w.csv_dict.has_key('manual.organisations.add_to_publisher')

        assert w.csv_dict['note.organisations'][1][
            0] == 'Leeds Metropolitan University'
        assert w.csv_dict['note.organisations'][2][0] == 'University of York'
        assert len(w.csv_dict['note.organisations'][2]) == 1
        assert 'Mark Foss ORG:University of Nottingham EMAIL:[email protected] END:vcard' in w.csv_dict[
            'note.organisations'][5]
        assert 'Aberystwyth University' in w.csv_dict['note.organisations'][5]
        assert 'Archmage College' not in w.csv_dict['note.organisations'][6]
        assert 'Fairy College' in w.csv_dict['note.organisations'][6]