diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-31 03:55:07 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 03:55:07 +0000 |
| commit | 91a833ab83fa9f36fcdc084ba65d0c2756f206b5 (patch) | |
| tree | ef9bed9e6bde64fdce53eed91d605f69e7e260cf | |
| parent | c21cf3a71141dac203260ef887e995b2382b1ec2 (diff) | |
automatic import of python-bddcli
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-bddcli.spec | 411 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 413 insertions, 0 deletions
@@ -0,0 +1 @@ +/bddcli-2.9.4.tar.gz diff --git a/python-bddcli.spec b/python-bddcli.spec new file mode 100644 index 0000000..6fa0505 --- /dev/null +++ b/python-bddcli.spec @@ -0,0 +1,411 @@ +%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. + +[](https://pypi.python.org/pypi/bddcli) +[](https://github.com/pylover/bddcli/actions) +[](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. + +[](https://pypi.python.org/pypi/bddcli) +[](https://github.com/pylover/bddcli/actions) +[](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. + +[](https://pypi.python.org/pypi/bddcli) +[](https://github.com/pylover/bddcli/actions) +[](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 <Python_Bot@openeuler.org> - 2.9.4-1 +- Package Spec generated @@ -0,0 +1 @@ +6ddb89a7a18aa76e83b616dfad90619d bddcli-2.9.4.tar.gz |
