diff --git a/tests/test_meta_entity.py b/tests/test_meta_entity.py index 0b755955fc824ffee81fd2e15096d27e90f6afac..f20e0abf5a09d4a35c81e05d49efa87d938612f8 100644 --- a/tests/test_meta_entity.py +++ b/tests/test_meta_entity.py @@ -21,19 +21,47 @@ from . import testutil from conservancy_beancount.plugin import meta_entity VALID_VALUES = { + # Classic entity: LastName-FirstName 'Smith-Alex', + # Various people and companies have one-word names + # Digits are allowed, as part of a name or standalone 'Company19', + 'Company-19', + # No case requirements 'boyd-danah', + # No limit on the number of parts of the name 'B-van-der-A', + # Names that have no ASCII are allowed, with or without dash separators + '田中流星', + '田中-流星', + 'スミスダコタ', + 'スミス-ダコタ', + 'Яшин-Данила', + # The PayPal importer produces . in entity metadata + 'Du-Bois-W.-E.-B.', + # import2ledger produces entities that end with - + # That's probably a bug, but allow it for now. + 'foo-', } INVALID_VALUES = { + # Starting with a - is not allowed '-foo', - 'foo-', '-', + # Names that can be reduced to ASCII should be + # Producers should change this to Uberentity or Ueberentity + # I am not wild about this rule and would like to relax it—it's mostly + # based on an expectation that entities are typed in by a human. That's true + # less and less and it seems like we should reduce the amount of mangling + # producers are expected to do. But it's the rule for today. 'Überentity', + # Whitespace is never allowed 'Alex Smith', + '田中 流星', + 'スミス ダコタ', + 'Яшин Данила', ' ', + # An empty string is not valid '', }