Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adopt_external_document() should type check its argument
- Loading branch information
1 parent
9585896
commit 9b7a17c
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Test cases related to direct loading of external libxml2 documents | ||
""" | ||
|
||
import unittest | ||
import sys | ||
|
||
from common_imports import etree, HelperTestCase | ||
|
||
|
||
@unittest.skipIf(sys.version_info[:2] < (2, 7), | ||
'Not supported for python < 2.7') | ||
class ExternalDocumentTestCase(HelperTestCase): | ||
def test_external_document_type_checking(self): | ||
self.assertRaises(TypeError, etree.adopt_external_document, None) | ||
|
||
|
||
def test_suite(): | ||
suite = unittest.TestSuite() | ||
suite.addTests([unittest.makeSuite(ExternalDocumentTestCase)]) | ||
return suite | ||
|
||
|
||
if __name__ == '__main__': | ||
print('to test use test.py %s' % __file__) |