File: test_memo.py

package info (click to toggle)
python-dbfread 2.0.7-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 384 kB
  • sloc: python: 1,146; makefile: 140
file content (14 lines) | stat: -rw-r--r-- 407 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from pytest import raises
from .dbf import DBF
from .exceptions import MissingMemoFile

def test_missing_memofile():
    with raises(MissingMemoFile):
        DBF('testcases/no_memofile.dbf')

    # This should succeed.
    table = DBF('testcases/no_memofile.dbf', ignore_missing_memofile=True)

    # Memo fields should be returned as None.
    record = next(iter(table))
    assert record['MEMO'] is None