%global _empty_manifest_terminate_build 0 Name: python-bddcli Version: 2.9.4 Release: 1 Summary: Test any command line interface in BDD manner. License: MIT URL: http://github.com/pylover/bddcli Source0: https://mirrors.nju.edu.cn/pypi/web/packages/00/65/510fc767394ee3af9fac7d5199ce69607fc807a48e9b5f7444e13de6b507/bddcli-2.9.4.tar.gz BuildArch: noarch %description # bddcli Test any command line interface in BDD manner. [![PyPI](http://img.shields.io/pypi/v/bddcli.svg)](https://pypi.python.org/pypi/bddcli) [![Build](https://github.com/pylover/bddcli/workflows/Build/badge.svg?branch=master)](https://github.com/pylover/bddcli/actions) [![Coverage Status](https://coveralls.io/repos/github/pylover/bddcli/badge.svg?branch=master)](https://coveralls.io/github/pylover/bddcli?branch=master) ### About A framework to easily test your command line interface in another(isolated) process and gather `stdout`, `stderr` and `exit-status` of the process. Thanks to https://github.com/cheremnov for the Windows support. ## Installation Only `Python >= 3.6` is supported. ```bash pip install bddcli ``` ## Quickstart ### Arguments ```python import sys from bddcli import Given, when, stdout, status, stderr, Application, given def foo(): print(' '.join(sys.argv)) return 0 app = Application('foo', 'mymodule:foo') with Given(app, 'bar'): assert status == 0 assert stdout == 'foo bar\n' # Without any argument when(given - 'bar') assert stdout == 'foo\n' # Pass multiple arguments when('bar baz') assert stdout == 'foo bar baz\n' # Pass multiple arguments, another method when(['bar', 'baz']) assert stdout == 'foo bar baz\n' # Add an argument when(given + 'baz') assert stdout == 'foo bar baz\n' ``` ### Standard input ```python with Given(app, stdin='foo'): assert ... # stdin is empty when(stdin='') assert ... ``` ### Standard output and error ```python from bddcli import stderr, stdout assert stderr == ... assert stdout == ... ``` ### Environment variables ```python import os from bddcli import Given, stdout, Application, when, given def foo(): e = os.environ.copy() del e['PWD'] print(' '.join(f'{k}: {v}' for k, v in e.items())) app = Application('foo', 'mymodule:foo') with Given(app, environ={'bar': 'baz'}): assert stdout == 'bar: baz\n' # Without any variable when(environ=given - 'bar') assert stdout == '\n' # Add another variables when(environ=given + {'qux': 'quux'}) assert stdout == 'bar: baz qux: quux\n' ``` See tests for more examples. %package -n python3-bddcli Summary: Test any command line interface in BDD manner. Provides: python-bddcli BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-bddcli # bddcli Test any command line interface in BDD manner. [![PyPI](http://img.shields.io/pypi/v/bddcli.svg)](https://pypi.python.org/pypi/bddcli) [![Build](https://github.com/pylover/bddcli/workflows/Build/badge.svg?branch=master)](https://github.com/pylover/bddcli/actions) [![Coverage Status](https://coveralls.io/repos/github/pylover/bddcli/badge.svg?branch=master)](https://coveralls.io/github/pylover/bddcli?branch=master) ### About A framework to easily test your command line interface in another(isolated) process and gather `stdout`, `stderr` and `exit-status` of the process. Thanks to https://github.com/cheremnov for the Windows support. ## Installation Only `Python >= 3.6` is supported. ```bash pip install bddcli ``` ## Quickstart ### Arguments ```python import sys from bddcli import Given, when, stdout, status, stderr, Application, given def foo(): print(' '.join(sys.argv)) return 0 app = Application('foo', 'mymodule:foo') with Given(app, 'bar'): assert status == 0 assert stdout == 'foo bar\n' # Without any argument when(given - 'bar') assert stdout == 'foo\n' # Pass multiple arguments when('bar baz') assert stdout == 'foo bar baz\n' # Pass multiple arguments, another method when(['bar', 'baz']) assert stdout == 'foo bar baz\n' # Add an argument when(given + 'baz') assert stdout == 'foo bar baz\n' ``` ### Standard input ```python with Given(app, stdin='foo'): assert ... # stdin is empty when(stdin='') assert ... ``` ### Standard output and error ```python from bddcli import stderr, stdout assert stderr == ... assert stdout == ... ``` ### Environment variables ```python import os from bddcli import Given, stdout, Application, when, given def foo(): e = os.environ.copy() del e['PWD'] print(' '.join(f'{k}: {v}' for k, v in e.items())) app = Application('foo', 'mymodule:foo') with Given(app, environ={'bar': 'baz'}): assert stdout == 'bar: baz\n' # Without any variable when(environ=given - 'bar') assert stdout == '\n' # Add another variables when(environ=given + {'qux': 'quux'}) assert stdout == 'bar: baz qux: quux\n' ``` See tests for more examples. %package help Summary: Development documents and examples for bddcli Provides: python3-bddcli-doc %description help # bddcli Test any command line interface in BDD manner. [![PyPI](http://img.shields.io/pypi/v/bddcli.svg)](https://pypi.python.org/pypi/bddcli) [![Build](https://github.com/pylover/bddcli/workflows/Build/badge.svg?branch=master)](https://github.com/pylover/bddcli/actions) [![Coverage Status](https://coveralls.io/repos/github/pylover/bddcli/badge.svg?branch=master)](https://coveralls.io/github/pylover/bddcli?branch=master) ### About A framework to easily test your command line interface in another(isolated) process and gather `stdout`, `stderr` and `exit-status` of the process. Thanks to https://github.com/cheremnov for the Windows support. ## Installation Only `Python >= 3.6` is supported. ```bash pip install bddcli ``` ## Quickstart ### Arguments ```python import sys from bddcli import Given, when, stdout, status, stderr, Application, given def foo(): print(' '.join(sys.argv)) return 0 app = Application('foo', 'mymodule:foo') with Given(app, 'bar'): assert status == 0 assert stdout == 'foo bar\n' # Without any argument when(given - 'bar') assert stdout == 'foo\n' # Pass multiple arguments when('bar baz') assert stdout == 'foo bar baz\n' # Pass multiple arguments, another method when(['bar', 'baz']) assert stdout == 'foo bar baz\n' # Add an argument when(given + 'baz') assert stdout == 'foo bar baz\n' ``` ### Standard input ```python with Given(app, stdin='foo'): assert ... # stdin is empty when(stdin='') assert ... ``` ### Standard output and error ```python from bddcli import stderr, stdout assert stderr == ... assert stdout == ... ``` ### Environment variables ```python import os from bddcli import Given, stdout, Application, when, given def foo(): e = os.environ.copy() del e['PWD'] print(' '.join(f'{k}: {v}' for k, v in e.items())) app = Application('foo', 'mymodule:foo') with Given(app, environ={'bar': 'baz'}): assert stdout == 'bar: baz\n' # Without any variable when(environ=given - 'bar') assert stdout == '\n' # Add another variables when(environ=given + {'qux': 'quux'}) assert stdout == 'bar: baz qux: quux\n' ``` See tests for more examples. %prep %autosetup -n bddcli-2.9.4 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-bddcli -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 31 2023 Python_Bot - 2.9.4-1 - Package Spec generated