Changeset 11410


Ignore:
Timestamp:
Mar 22, 2012, 9:15:22 PM (8 years ago)
Author:
osimons
Message:

XmlRpcPlugin: Small fix + test to gracefully handle running Python optimized (-OO) that may in fact strip all docstrings (leaving them as None). Fixes #9919.

Running python -OO setup.py test will now at least fail this new test that depends on ability to introspect docstrings.

Location:
xmlrpcplugin/trunk/tracrpc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • xmlrpcplugin/trunk/tracrpc/tests/api.py

    r7916 r11410  
    3737            self.assertEquals(e.fp.read(),
    3838                "No protocol matching Content-Type 'text/plain' at path '/rpc'.")
     39
     40    def test_rpc_info(self):
     41        # Just try getting the docs for XML-RPC to test, it should always exist
     42        from tracrpc.xml_rpc import XmlRpcProtocol
     43        xmlrpc = XmlRpcProtocol(rpc_testenv.get_trac_environment())
     44        name, docs = xmlrpc.rpc_info()
     45        self.assertEquals(name, 'XML-RPC')
     46        self.assertTrue('Content-Type: application/xml' in docs)
    3947
    4048    def test_valid_provider(self):
  • xmlrpcplugin/trunk/tracrpc/util.py

    r7916 r11410  
    4747def prepare_docs(text, indent=4):
    4848    r"""Remove leading whitespace"""
    49     return ''.join(l[indent:] for l in text.splitlines(True))
     49    return text and ''.join(l[indent:] for l in text.splitlines(True)) or ''
    5050
    5151try:
Note: See TracChangeset for help on using the changeset viewer.