~ubuntu-branches/ubuntu/utopic/python-docutils/utopic

« back to all changes in this revision

Viewing changes to test/test_readers/test_get_reader_class.py

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2012-10-19 18:23:15 UTC
  • mfrom: (1.2.1) (11.1.6 experimental)
  • Revision ID: package-import@ubuntu.com-20121019182315-ln3lvct1pqq7mzgm
Tags: 0.9.1+svn7532-0ubuntu1
* Resynchronize with Debian packaging SVN, remaining change:
  - Use dh_python2 instead of dh_pysupport.
* New snapshot from upstream SVN, fixes build with Python 3.3.
* Add XS-Testsuite header.
* debian/patches/move-data-to-usr-share.diff: unfuzz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
 
 
3
# $Id$
 
4
# Author: grubert abadger1999
 
5
# Maintainer: docutils-develop@lists.sourceforge.net
 
6
# Copyright: This module has been placed in the public domain.
 
7
 
 
8
"""
 
9
test get_reader_class
 
10
"""
 
11
 
 
12
from __init__ import DocutilsTestSupport
 
13
from docutils.readers import get_reader_class
 
14
 
 
15
class GetReaderClassTestCase(DocutilsTestSupport.StandardTestCase):
 
16
 
 
17
    def test_registered_reader(self):
 
18
        rdr = get_reader_class('pep')
 
19
        # raises ImportError on failure
 
20
 
 
21
    def test_bogus_reader(self):
 
22
        self.assertRaises(ImportError,
 
23
                          get_reader_class, 'nope')
 
24
 
 
25
    def test_local_reader(self):
 
26
        # requires local-reader.py in test directory (testroot)
 
27
        wr = get_reader_class('local-reader')
 
28
 
 
29
if __name__ == '__main__':
 
30
    import unittest
 
31
    unittest.main()
 
32