mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix smarypants test runner
This commit is contained in:
parent
f9abbe9800
commit
f934e47968
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
__author__ = "Chad Miller <smartypantspy@chad.org>, Kovid Goyal <kovid at kovidgoyal.net>"
|
||||||
|
__description__ = "Smart-quotes, smart-ellipses, and smart-dashes for weblog entries in pyblosxom"
|
||||||
|
|
||||||
r"""
|
r"""
|
||||||
==============
|
==============
|
||||||
smartypants.py
|
smartypants.py
|
||||||
@ -876,22 +879,7 @@ def _tokenize(str):
|
|||||||
|
|
||||||
return tokens
|
return tokens
|
||||||
|
|
||||||
|
def run_tests():
|
||||||
if __name__ == "__main__":
|
|
||||||
|
|
||||||
import locale
|
|
||||||
|
|
||||||
try:
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
from docutils.core import publish_string
|
|
||||||
docstring_html = publish_string(__doc__, writer_name='html')
|
|
||||||
|
|
||||||
print docstring_html
|
|
||||||
|
|
||||||
# Unit test output goes out stderr. No worries.
|
|
||||||
import unittest
|
import unittest
|
||||||
sp = smartyPants
|
sp = smartyPants
|
||||||
|
|
||||||
@ -926,10 +914,9 @@ if __name__ == "__main__":
|
|||||||
def test_educated_quotes(self):
|
def test_educated_quotes(self):
|
||||||
self.assertEqual(sp('''"Isn't this fun?"'''), '''“Isn’t this fun?”''')
|
self.assertEqual(sp('''"Isn't this fun?"'''), '''“Isn’t this fun?”''')
|
||||||
|
|
||||||
unittest.main()
|
tests = unittest.defaultTestLoader.loadTestsFromTestCase(TestSmartypantsAllAttributes)
|
||||||
|
unittest.TextTestRunner(verbosity=4).run(tests)
|
||||||
|
|
||||||
|
|
||||||
__author__ = "Chad Miller <smartypantspy@chad.org>"
|
if __name__ == "__main__":
|
||||||
__version__ = "1.5_1.6: Fri, 27 Jul 2007 07:06:40 -0400"
|
run_tests()
|
||||||
__url__ = "http://wiki.chad.org/SmartyPantsPy"
|
|
||||||
__description__ = "Smart-quotes, smart-ellipses, and smart-dashes for weblog entries in pyblosxom"
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user