Python Forum
Running Python Packages
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running Python Packages
#5
(Jan-28-2020, 08:35 PM)jefsummers Wrote: How do you expect it to display your results?
You are not including enough code or information to be able to help

Here's the afdko source code specific Type1.py executable?

import pytest
import subprocess

from runner import main as runner
from differ import main as differ
from test_utils import get_expected_path

TOOL = 'type1'


# -----
# Tests
# -----

@pytest.mark.parametrize('arg', ['-h'])
def test_exit_known_option(arg):
    assert subprocess.call([TOOL, arg]) == 0


@pytest.mark.parametrize('arg', ['-v', '-u'])
def test_exit_unknown_option(arg):
    assert subprocess.call([TOOL, arg]) == 1


def test_run_on_txt_data():
    actual_path = runner(['-t', TOOL, '-s', '-f', 'type1.txt'])
    expected_path = get_expected_path('type1.pfa')
    assert differ([expected_path, actual_path])
Does this help?
Reply


Messages In This Thread
Running Python Packages - by mojobadshah - Jan-27-2020, 07:19 PM
RE: Running Python Packages - by jefsummers - Jan-27-2020, 08:55 PM
RE: Running Python Packages - by mojobadshah - Jan-28-2020, 07:11 PM
RE: Running Python Packages - by jefsummers - Jan-28-2020, 08:35 PM
RE: Running Python Packages - by mojobadshah - Jan-29-2020, 07:32 PM
RE: Running Python Packages - by mojobadshah - Jan-30-2020, 04:23 AM
RE: Running Python Packages - by jefsummers - Jan-29-2020, 09:07 PM
RE: Running Python Packages - by jefsummers - Jan-30-2020, 12:37 PM
RE: Running Python Packages - by mojobadshah - Jan-30-2020, 05:07 PM
RE: Running Python Packages - by jefsummers - Jan-30-2020, 07:11 PM
RE: Running Python Packages - by mojobadshah - Jan-30-2020, 10:28 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020