def test_generateLine_attribute(): """ Check inventory for attributes. """ sut = make_SphinxInventory() parent = model.Class("ignore-system", "class1", "docstring") result = sut._generateLine( model.Attribute("ignore-system", "attr1", "ignore-docstring", parent)) assert "class1.attr1 py:attribute -1 class1.html#attr1 -\n" == result
def test_generateLine_attribute(): """ Check inventory for attributes. """ sut = make_SphinxInventory() parent = model.Class('ignore-system', 'class1', 'docstring') result = sut._generateLine( model.Attribute('ignore-system', 'attr1', 'ignore-docstring', parent)) assert 'class1.attr1 py:attribute -1 class1.html#attr1 -\n' == result
def test_generateLine_attribute(): """ Check inventory for attributes. """ sut = sphinx.SphinxInventoryWriter(logger=object(), project_name='project_name') parent = model.Class('ignore-system', 'class1') result = sut._generateLine( model.Attribute('ignore-system', 'attr1', parent)) assert 'class1.attr1 py:attribute -1 class1.html#attr1 -\n' == result
def test_generateLine_attribute( inv_writer_nolog: sphinx.SphinxInventoryWriter) -> None: """ Check inventory for attributes. """ parent = model.Class(IGNORE_SYSTEM, 'class1') result = inv_writer_nolog._generateLine( model.Attribute(IGNORE_SYSTEM, 'attr1', parent)) assert 'class1.attr1 py:attribute -1 class1.html#attr1 -\n' == result
def addAttribute(self, target, docstring, kind, lineno, parent=None): if parent is None: parent = self.current system = self.system parentMod = self.currentMod attr = model.Attribute(system, target, docstring, parent) attr.kind = kind attr.parentMod = parentMod attr.linenumber = lineno if parentMod.sourceHref: attr.sourceHref = '%s#L%d' % (parentMod.sourceHref, lineno) system.addObject(attr) return attr