File: test_tesselate.py

package info (click to toggle)
librepcb 1.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 58,484 kB
  • sloc: cpp: 267,986; python: 12,100; ansic: 6,899; xml: 234; sh: 215; makefile: 115; perl: 73
file content (26 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pytest
import re

"""
Test command "open-step --tesselate"
"""


PATTERN = "Open STEP file '{path}'...\\n" \
          "Load model...\\n" \
          "Tesselate model...\\n" \
          " - Built \\d\\d+ vertices with [1-9]\\d* different colors\\n" \
          "SUCCESS\\n"


def test_valid_file(cli):
    fp = cli.add_file('unittests/librepcbcommon/OccModelTest/model.step')
    code, stdout, stderr = cli.run('open-step', '--tesselate', fp)
    if 'LibrePCB was compiled without OpenCascade' in stderr:
        pytest.skip("Feature not available.")
    assert stderr == ''
    assert re.fullmatch(PATTERN.format(path=re.escape(fp)), stdout)
    assert code == 0