Changeset - 4a28596db267
[Not reviewed]
0 3 0
Brett Smith - 4 years ago 2020-06-15 22:08:18
brettcsmith@brettcsmith.org
data: bank-statement and tax-statement are link metadata.

Not including them earlier was an oversight.
3 files changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/data.py
Show inline comments
...
 
@@ -47,31 +47,33 @@ from typing import (
 
from .beancount_types import (
 
    Directive,
 
    MetaKey,
 
    MetaValue,
 
    Posting as BasePosting,
 
    Transaction,
 
)
 

	
 
DecimalCompat = Union[decimal.Decimal, int]
 

	
 
LINK_METADATA = frozenset([
 
    'approval',
 
    'bank-statement',
 
    'check',
 
    'contract',
 
    'invoice',
 
    'purchase-order',
 
    'receipt',
 
    'rt-id',
 
    'statement',
 
    'tax-statement',
 
])
 

	
 
class Account(str):
 
    """Account name string
 

	
 
    This is a string that names an account, like Assets:Bank:Checking
 
    or Income:Donations. This class provides additional methods for common
 
    account name parsing and queries.
 
    """
 
    __slots__ = ()
 

	
 
    SEP = bc_account.sep
tests/test_meta_repo_links.py
Show inline comments
...
 
@@ -18,30 +18,32 @@ import itertools
 

	
 
from pathlib import Path
 

	
 
import pytest
 

	
 
from . import testutil
 

	
 
from conservancy_beancount import errors as errormod
 
from conservancy_beancount.plugin import meta_repo_links
 

	
 
METADATA_KEYS = [
 
    'approval',
 
    'bank-statement',
 
    'check',
 
    'contract',
 
    'invoice',
 
    'purchase-order',
 
    'receipt',
 
    'statement',
 
    'tax-statement',
 
]
 

	
 
GOOD_LINKS = [Path(s) for s in [
 
    'Projects/project-data.yml',
 
    'Projects/project-list.yml',
 
]]
 

	
 
BAD_LINKS = [Path(s) for s in [
 
    'NonexistentDirectory/NonexistentFile1.txt',
 
    'NonexistentDirectory/NonexistentFile2.txt',
 
]]
 

	
tests/test_meta_rt_links.py
Show inline comments
...
 
@@ -16,31 +16,33 @@
 

	
 
import itertools
 

	
 
import pytest
 

	
 
from . import testutil
 

	
 
from conservancy_beancount import errors as errormod
 
from conservancy_beancount.plugin import meta_rt_links
 

	
 
METADATA_KEYS = [
 
    'approval',
 
    'bank-statement',
 
    'check',
 
    'contract',
 
    'invoice',
 
    'purchase-order',
 
    'receipt',
 
    'rt-id',
 
    'statement',
 
    'tax-statement',
 
]
 

	
 
GOOD_LINKS = [
 
    'rt:1',
 
    'rt:1/5',
 
    'rt://ticket/2',
 
    'rt://ticket/3/attachments/15',
 
]
 

	
 
MALFORMED_LINKS = [
 
    'rt:one',
 
    'rt:two/three',
0 comments (0 inline, 0 general)