initial template commit
This commit is contained in:
7
test/__init__.py
Normal file
7
test/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# pygamecfg (c) by chacha
|
||||
#
|
||||
# pygamecfg is licensed under a
|
||||
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Unported License.
|
||||
#
|
||||
# You should have received a copy of the license along with this
|
||||
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.
|
||||
32
test/test_test_module.py
Normal file
32
test/test_test_module.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# pygamecfg (c) by chacha
|
||||
#
|
||||
# pygamecfg is licensed under a
|
||||
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Unported License.
|
||||
#
|
||||
# You should have received a copy of the license along with this
|
||||
# work. If not, see <https://creativecommons.org/licenses/by-nc-sa/4.0/>.
|
||||
|
||||
import unittest
|
||||
from io import StringIO
|
||||
from contextlib import redirect_stdout,redirect_stderr
|
||||
|
||||
print(__name__)
|
||||
print(__package__)
|
||||
|
||||
from src import pygamecfg
|
||||
|
||||
class Testtest_module(unittest.TestCase):
|
||||
def test_version(self):
|
||||
self.assertNotEqual(pygamecfg.__version__,"?.?.?")
|
||||
|
||||
def test_test_module(self):
|
||||
|
||||
with redirect_stdout(StringIO()) as capted_stdout, redirect_stderr(StringIO()) as capted_stderr:
|
||||
self.assertEqual(pygamecfg.test_function(41),42)
|
||||
|
||||
self.assertEqual(len(capted_stderr.getvalue()),0)
|
||||
self.assertEqual(capted_stdout.getvalue().strip(),"Hello world !")
|
||||
self.assertEqual(len(capted_stderr.getvalue()),0)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user