diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:45:20 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:45:20 +0000 |
| commit | 07c9846a0ec46073cd798472ea4a8674ef8419e3 (patch) | |
| tree | 20a271c2f60cdd4fa0dfb2d60cd3463da841b974 | |
| parent | 860b8924c65f66be127985e7dc38ae1274eafed9 (diff) | |
automatic import of python-paramunittestopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-paramunittest.spec | 192 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 194 insertions, 0 deletions
@@ -0,0 +1 @@ +/ParamUnittest-0.2.tar.gz diff --git a/python-paramunittest.spec b/python-paramunittest.spec new file mode 100644 index 0000000..91a3269 --- /dev/null +++ b/python-paramunittest.spec @@ -0,0 +1,192 @@ +%global _empty_manifest_terminate_build 0 +Name: python-ParamUnittest +Version: 0.2 +Release: 1 +Summary: Simple extension to have parametrized unit tests. +License: BSD +URL: https://github.com/rik0/ParamUnittest +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a8/63/7b69e8db183bb3592295f6d086cbc46be9bdbe6fdfa0d9f924a682faa5ae/ParamUnittest-0.2.tar.gz +BuildArch: noarch + + +%description +This package allows to create parametrized unit-tests that work with the +standard unittest package. A parametrized test case is automatically +converted to multiple test cases. Since they are TestCase subclasses, +they work with other test suites that recognize TestCases. + +Examples:: + + import unittest + import paramunittest + + @paramunittest.parametrized( + ('1', '2'), + #(4, 3), + ('2', '3'), + (('4', ), {'b': '5'}), + ((), {'a': 5, 'b': 6}), + {'a': 5, 'b': 6}, + ) + class TestFoo(paramunittest.ParametrizedTestCase): + def setParameters(self, a, b): + self.a = a + self.b = b + + def testLess(self): + self.assertLess(self.a, self.b) + + @paramunittest.parametrized( + ('1', '2'), + #(4, 3), + ('2', '3'), + (('4', ), {'b': '5'}), + ((), {'a': 5, 'b': 6}), + {'a': 5, 'b': 6}, + ) + class TestBar(unittest.TestCase): + def setParameters(self, a, b): + self.a = a + self.b = b + + def testLess(self): + self.assertLess(self.a, self.b) + +%package -n python3-ParamUnittest +Summary: Simple extension to have parametrized unit tests. +Provides: python-ParamUnittest +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-ParamUnittest +This package allows to create parametrized unit-tests that work with the +standard unittest package. A parametrized test case is automatically +converted to multiple test cases. Since they are TestCase subclasses, +they work with other test suites that recognize TestCases. + +Examples:: + + import unittest + import paramunittest + + @paramunittest.parametrized( + ('1', '2'), + #(4, 3), + ('2', '3'), + (('4', ), {'b': '5'}), + ((), {'a': 5, 'b': 6}), + {'a': 5, 'b': 6}, + ) + class TestFoo(paramunittest.ParametrizedTestCase): + def setParameters(self, a, b): + self.a = a + self.b = b + + def testLess(self): + self.assertLess(self.a, self.b) + + @paramunittest.parametrized( + ('1', '2'), + #(4, 3), + ('2', '3'), + (('4', ), {'b': '5'}), + ((), {'a': 5, 'b': 6}), + {'a': 5, 'b': 6}, + ) + class TestBar(unittest.TestCase): + def setParameters(self, a, b): + self.a = a + self.b = b + + def testLess(self): + self.assertLess(self.a, self.b) + +%package help +Summary: Development documents and examples for ParamUnittest +Provides: python3-ParamUnittest-doc +%description help +This package allows to create parametrized unit-tests that work with the +standard unittest package. A parametrized test case is automatically +converted to multiple test cases. Since they are TestCase subclasses, +they work with other test suites that recognize TestCases. + +Examples:: + + import unittest + import paramunittest + + @paramunittest.parametrized( + ('1', '2'), + #(4, 3), + ('2', '3'), + (('4', ), {'b': '5'}), + ((), {'a': 5, 'b': 6}), + {'a': 5, 'b': 6}, + ) + class TestFoo(paramunittest.ParametrizedTestCase): + def setParameters(self, a, b): + self.a = a + self.b = b + + def testLess(self): + self.assertLess(self.a, self.b) + + @paramunittest.parametrized( + ('1', '2'), + #(4, 3), + ('2', '3'), + (('4', ), {'b': '5'}), + ((), {'a': 5, 'b': 6}), + {'a': 5, 'b': 6}, + ) + class TestBar(unittest.TestCase): + def setParameters(self, a, b): + self.a = a + self.b = b + + def testLess(self): + self.assertLess(self.a, self.b) + +%prep +%autosetup -n ParamUnittest-0.2 + +%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-ParamUnittest -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2-1 +- Package Spec generated @@ -0,0 +1 @@ +982731aa4c09b4a9c8e3d7668fa2186a ParamUnittest-0.2.tar.gz |
