File: test_utils.py

package info (click to toggle)
python-mt-940 4.30.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,272 kB
  • sloc: python: 1,746; makefile: 201
file content (17 lines) | stat: -rw-r--r-- 443 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from mt940 import utils


@pytest.mark.parametrize('input_,flags,output', [
    (' a \n b ', None, 'ab'),
    (' a \n b ', utils.Strip.LEFT, 'a b '),
    (' a \n b ', utils.Strip.RIGHT, ' a b'),
    (' a \n b ', utils.Strip.NONE, ' a  b '),

])
def test_join_lines(input_, flags, output):
    if flags is None:
        assert utils.join_lines(input_) == output
    else:
        assert utils.join_lines(input_, flags) == output