def test_parses(self):
     """
     Parsing of the example objects.inv in the current directory does not
     fail.
     """
     p = InterSphinxParser(doc_path=os.path.join(HERE))
     assert [] != list(p.parse())
Exemple #2
0
 def test_parses(self):
     """
     Parsing of the example objects.inv in the current directory does not
     fail.
     """
     p = InterSphinxParser(doc_path=os.path.join(HERE))
     assert [] != list(p.parse())
 def test_inv_to_entries(self):
     """
     Inventory items are correctly converted.
     """
     p = InterSphinxParser(doc_path=os.path.join(HERE))
     result = list(
         p._inv_to_entries({"py:method": {
             u"some_method": (None, None, u"some_module.py", u"-"),
         }, "std:option": {
             u"--destination": (
                 u"doc2dash",
                 u"2.0",
                 u"index.html#document-usage#cmdoption--destination",
                 u"-"
             )
         }, "std:constant": {
             u"SomeConstant": (None, None, u"some_other_module.py", u"-")
         }})
     )
     assert set([ParserEntry(
         name=u'some_method', type=u'Method', path=u'some_module.py'
         ),
         ParserEntry(
             name=u'--destination',
             type=u'Option',
             path=u'index.html#cmdoption--destination'
         ),
         ParserEntry(
             name=u'SomeConstant',
             type=u'Constant',
             path=u'some_other_module.py',
         )
     ]) == set(result)
Exemple #4
0
 def test_parses(self):
     """
     Parsing does not fail.
     """
     p = InterSphinxParser(os.path.join(HERE))
     for t in p.parse():
         pass
Exemple #5
0
 def test_inv_to_entries(self):
     """
     Inventory items are correctly converted.
     """
     p = InterSphinxParser(doc_path=os.path.join(HERE))
     result = list(
         p._inv_to_entries({
             "py:method": {
                 "some_method": (None, None, "some_module.py", "-")
             },
             "std:option": {
                 "--destination": (
                     "doc2dash",
                     "2.0",
                     "index.html#document-usage#cmdoption--"
                     "destination",
                     "-",
                 )
             },
             "std:constant": {
                 "SomeConstant": (
                     None,
                     None,
                     "some_other_module.py",
                     "-",
                 )
             },
         }))
     assert {
         ParserEntry(
             name="some_method",
             type="Method",
             path="some_module.py",
         ),
         ParserEntry(
             name="--destination",
             type="Option",
             path="index.html#cmdoption--destination",
         ),
         ParserEntry(
             name="SomeConstant",
             type="Constant",
             path="some_other_module.py",
         ),
     } == set(result)
 def test_interface(self):
     """
     InterSphinxParser fully implements IParser.
     """
     verifyObject(IParser, InterSphinxParser(doc_path="foo"))