%global _empty_manifest_terminate_build 0 Name: python-scripttester Version: 0.1 Release: 1 Summary: Utility for testing command line scripts License: BSD license URL: http://github.com/matthew-brett/scripttester Source0: https://mirrors.nju.edu.cn/pypi/web/packages/4b/8c/938e078b90f4d085aad7c31192efd4f7aadc2e1da6de54c6f7428c340553/scripttester-0.1.tar.gz BuildArch: noarch %description ####################################################### ScriptTester - utility for testing command line scripts ####################################################### .. shared-text-body ********** Quickstart ********** Provides class to be instantiated in tests that check that scripts can be run and give correct output. Usually works something like this in a test module:: import mymodule from scripttester import ScriptTester runner = ScriptTester(mymodule) Then, in the tests, something like:: code, stdout, stderr = runner.run_command(['my-script', my_arg]) assert code == 0 assert stdout == b'This script ran OK' The class aims to find your scripts whether you have installed (with ``pip install .`` or ``pip install -e .`` or ``python setup.py install``), or not. If you have not installed, the scripts will not be on your system PATH, and we have to find them. The heuristic is to look (by default) in the directory containing ``mymodule``; if there is a ``setup.py`` file there, and a ``scripts`` sub-directory, assume that directory contains the scripts. Note there is no way of using this not-installed mechanism to find entrypoint scripts, that have not been installed. To find these, we would have to run the ``setup.py`` file. ************ Installation ************ :: pip install scripttester **** Code **** See https://github.com/matthew-brett/scripttester Released under the BSD two-clause license - see the file ``LICENSE`` in the source distribution. `travis-ci `_ kindly tests the code automatically under Python versions 2.7, and 3.3 through 3.6. The latest released version is at https://pypi.python.org/pypi/scripttester ***** Tests ***** * Install ``scripttester`` * Install the pytest_ testing framework:: pip install pytest * Run the tests with:: py.test --pyargs scripttester ******* Support ******* Please put up issues on the `scripttester issue tracker`_. .. standalone-references .. |scripttester-documentation| replace:: `scripttester documentation`_ .. _scripttester documentation: https://matthew-brett.github.com/scripttester/scripttester.html .. _documentation: https://matthew-brett.github.com/scripttester .. _pandoc: http://pandoc.org .. _jupyter: jupyter.org .. _homebrew: brew.sh .. _sphinx: http://sphinx-doc.org .. _rest: http://docutils.sourceforge.net/rst.html .. _scripttester issue tracker: https://github.com/matthew-brett/scripttester/issues .. _pytest: https://pytest.readthedocs.io .. _mock: https://github.com/testing-cabal/mock %package -n python3-scripttester Summary: Utility for testing command line scripts Provides: python-scripttester BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-scripttester ####################################################### ScriptTester - utility for testing command line scripts ####################################################### .. shared-text-body ********** Quickstart ********** Provides class to be instantiated in tests that check that scripts can be run and give correct output. Usually works something like this in a test module:: import mymodule from scripttester import ScriptTester runner = ScriptTester(mymodule) Then, in the tests, something like:: code, stdout, stderr = runner.run_command(['my-script', my_arg]) assert code == 0 assert stdout == b'This script ran OK' The class aims to find your scripts whether you have installed (with ``pip install .`` or ``pip install -e .`` or ``python setup.py install``), or not. If you have not installed, the scripts will not be on your system PATH, and we have to find them. The heuristic is to look (by default) in the directory containing ``mymodule``; if there is a ``setup.py`` file there, and a ``scripts`` sub-directory, assume that directory contains the scripts. Note there is no way of using this not-installed mechanism to find entrypoint scripts, that have not been installed. To find these, we would have to run the ``setup.py`` file. ************ Installation ************ :: pip install scripttester **** Code **** See https://github.com/matthew-brett/scripttester Released under the BSD two-clause license - see the file ``LICENSE`` in the source distribution. `travis-ci `_ kindly tests the code automatically under Python versions 2.7, and 3.3 through 3.6. The latest released version is at https://pypi.python.org/pypi/scripttester ***** Tests ***** * Install ``scripttester`` * Install the pytest_ testing framework:: pip install pytest * Run the tests with:: py.test --pyargs scripttester ******* Support ******* Please put up issues on the `scripttester issue tracker`_. .. standalone-references .. |scripttester-documentation| replace:: `scripttester documentation`_ .. _scripttester documentation: https://matthew-brett.github.com/scripttester/scripttester.html .. _documentation: https://matthew-brett.github.com/scripttester .. _pandoc: http://pandoc.org .. _jupyter: jupyter.org .. _homebrew: brew.sh .. _sphinx: http://sphinx-doc.org .. _rest: http://docutils.sourceforge.net/rst.html .. _scripttester issue tracker: https://github.com/matthew-brett/scripttester/issues .. _pytest: https://pytest.readthedocs.io .. _mock: https://github.com/testing-cabal/mock %package help Summary: Development documents and examples for scripttester Provides: python3-scripttester-doc %description help ####################################################### ScriptTester - utility for testing command line scripts ####################################################### .. shared-text-body ********** Quickstart ********** Provides class to be instantiated in tests that check that scripts can be run and give correct output. Usually works something like this in a test module:: import mymodule from scripttester import ScriptTester runner = ScriptTester(mymodule) Then, in the tests, something like:: code, stdout, stderr = runner.run_command(['my-script', my_arg]) assert code == 0 assert stdout == b'This script ran OK' The class aims to find your scripts whether you have installed (with ``pip install .`` or ``pip install -e .`` or ``python setup.py install``), or not. If you have not installed, the scripts will not be on your system PATH, and we have to find them. The heuristic is to look (by default) in the directory containing ``mymodule``; if there is a ``setup.py`` file there, and a ``scripts`` sub-directory, assume that directory contains the scripts. Note there is no way of using this not-installed mechanism to find entrypoint scripts, that have not been installed. To find these, we would have to run the ``setup.py`` file. ************ Installation ************ :: pip install scripttester **** Code **** See https://github.com/matthew-brett/scripttester Released under the BSD two-clause license - see the file ``LICENSE`` in the source distribution. `travis-ci `_ kindly tests the code automatically under Python versions 2.7, and 3.3 through 3.6. The latest released version is at https://pypi.python.org/pypi/scripttester ***** Tests ***** * Install ``scripttester`` * Install the pytest_ testing framework:: pip install pytest * Run the tests with:: py.test --pyargs scripttester ******* Support ******* Please put up issues on the `scripttester issue tracker`_. .. standalone-references .. |scripttester-documentation| replace:: `scripttester documentation`_ .. _scripttester documentation: https://matthew-brett.github.com/scripttester/scripttester.html .. _documentation: https://matthew-brett.github.com/scripttester .. _pandoc: http://pandoc.org .. _jupyter: jupyter.org .. _homebrew: brew.sh .. _sphinx: http://sphinx-doc.org .. _rest: http://docutils.sourceforge.net/rst.html .. _scripttester issue tracker: https://github.com/matthew-brett/scripttester/issues .. _pytest: https://pytest.readthedocs.io .. _mock: https://github.com/testing-cabal/mock %prep %autosetup -n scripttester-0.1 %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-scripttester -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu Mar 09 2023 Python_Bot - 0.1-1 - Package Spec generated