This commit is contained in:
George 2024-12-27 00:28:01 -08:00
commit eb9b49c962
8 changed files with 54 additions and 0 deletions

1
LICENSE Normal file
View File

@ -0,0 +1 @@
Test MIT

6
README.md Normal file
View File

@ -0,0 +1,6 @@
# Test README
test
```bash
install

20
setup.py Normal file
View File

@ -0,0 +1,20 @@
from setuptools import setup, find_packages
setup(
name="testpkg",
version="0.1",
packages=find_packages(),
install_requires=[],
author="Test",
author_email="test@dont_spam_me.co",
description="A simple example private package",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
# url="https://github.com/nydasco/package_publishing",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
)

2
testpkg/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from .mod1 import test_add, test_sub
from .mod2 import test_mul, test_div

5
testpkg/mod1.py Normal file
View File

@ -0,0 +1,5 @@
def test_add(a, b):
return a+b
def test_sub(a, b):
return a-b

5
testpkg/mod2.py Normal file
View File

@ -0,0 +1,5 @@
def test_mul(a, b):
return a*b
def test_div(a, b):
return a/b

0
tests/__init__.py Normal file
View File

15
tests/test1.py Normal file
View File

@ -0,0 +1,15 @@
import unittest
from testpkg import test_add, test_sub
class TestModule1(unittest.TestCase):
def test_add(self):
self.assertEqual(test_add(1, 2), 3)
self.assertEqual(test_add(-1, 1), 0)
def test_subtract(self):
self.assertEqual(test_sub(2, 1), 1)
self.assertEqual(test_sub(2, 3), -1)
if __name__ == "__main__":
unittest.main()