File: test_command.py

package info (click to toggle)
python-docxcompose 1.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,100 kB
  • sloc: python: 2,336; makefile: 14; xml: 5; sh: 3
file content (19 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from docxcompose import command
from utils import docx_path
import pytest


def test_command_creates_composed_docx_file_at_output_path(tmpdir):
    output_path = tmpdir.join('outfile.docx')
    assert not output_path.exists()

    arguments = [docx_path('master.docx'),
                 docx_path('table.docx'),
                 '--output-document', output_path.strpath]
    with pytest.raises(SystemExit) as exc_info:
        command.main(arguments)

    assert exc_info.value.code == 0
    assert output_path.exists()
    assert output_path.isfile()
    assert output_path.size() > 0