summaryrefslogtreecommitdiff
path: root/tests/test_sphinxext.py
diff options
context:
space:
mode:
authorJim Rollenhagen <jim@jimrollenhagen.com>2019-09-26 09:43:27 -0400
committerJim Rollenhagen <jim@jimrollenhagen.com>2019-09-26 09:43:27 -0400
commite9c6edfe510f4ed407f8d2d84b4b931a382b48b3 (patch)
tree94bbd6a34bcf09e99f7ae1be88b19960192d6adb /tests/test_sphinxext.py
parent1d73d6e50411ebc45fb96a6ed3c63ca91a500323 (diff)
downloadwsme-master.tar.gz
Retire github mirror, repo moved to opendevHEADmaster
Diffstat (limited to 'tests/test_sphinxext.py')
-rw-r--r--tests/test_sphinxext.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/tests/test_sphinxext.py b/tests/test_sphinxext.py
deleted file mode 100644
index 78f80dd..0000000
--- a/tests/test_sphinxext.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import unittest
-import sphinx
-import os.path
-
-import wsme.types
-from wsmeext import sphinxext
-
-docpath = os.path.join(
- os.path.dirname(__file__),
- 'sphinxexample')
-
-
-class ASampleType(object):
- somebytes = wsme.types.bytes
- sometext = wsme.types.text
- someint = int
-
-
-class TestSphinxExt(unittest.TestCase):
- def test_buildhtml(self):
- if not os.path.exists('.test_sphinxext/'):
- os.makedirs('.test_sphinxext/')
- try:
- sphinx.main([
- '',
- '-b', 'html',
- '-d', '.test_sphinxext/doctree',
- docpath,
- '.test_sphinxext/html'
- ])
- assert Exception("Should raise SystemExit 0")
- except SystemExit as e:
- assert e.code == 0
-
-
-class TestDataTypeName(unittest.TestCase):
- def test_user_type(self):
- self.assertEqual(sphinxext.datatypename(ASampleType),
- 'ASampleType')
-
- def test_dict_type(self):
- d = wsme.types.DictType(str, str)
- self.assertEqual(sphinxext.datatypename(d), 'dict(str: str)')
- d = wsme.types.DictType(str, ASampleType)
- self.assertEqual(sphinxext.datatypename(d), 'dict(str: ASampleType)')
-
- def test_array_type(self):
- d = wsme.types.ArrayType(str)
- self.assertEqual(sphinxext.datatypename(d), 'list(str)')
- d = wsme.types.ArrayType(ASampleType)
- self.assertEqual(sphinxext.datatypename(d), 'list(ASampleType)')