def display_data(): from foolscap.meta_data import NotesModel from foolscap.note_display import ServiceRules patch_load = 'foolscap.meta_data.models.load_meta' with patch(patch_load, return_value=FAKE_FOUR_NOTES_W_SUB): model = NotesModel() service_rules = ServiceRules(model) items = list(model) items = service_rules.order(items) items = service_rules.alphabetise(items) return service_rules.structure(items)
def test_servicerule_alphabetise(note_model, notes, expected): service = ServiceRules(note_model) result = service.alphabetise(notes) assert result == expected