Ejemplo n.º 1
0
 def test_valid_invalid_link(self):
     """Verify a tree is invalid with a bad link."""
     item = core.Item(self.ITEM)
     item.add_link('SYS003')
     tree = core.build(FILES, root=FILES)
     self.assertIsInstance(tree, core.Tree)
     self.assertFalse(tree.valid())
Ejemplo n.º 2
0
 def test_lines_html_document_with_header(self):
     """Verify HTML can be published from a document with headers and child links contain header"""
     path = os.path.join(FILES_BETA, 'published3.html')
     expected = common.read_text(path)
     beta_features_tree = core.build(cwd=FILES_BETA, root=FILES_BETA)
     document_with_header = beta_features_tree.find_document('REQHEADER')
     # Act
     lines = core.publisher.publish_lines(document_with_header, '.html',
                                          linkify=True)
     text = ''.join(line + '\n' for line in lines)
     # Assert
     if CHECK_PUBLISHED_CONTENT:
         self.assertEqual(expected, text)
     common.write_text(text, path)
Ejemplo n.º 3
0
 def test_lines_html_document_with_header(self):
     """Verify HTML can be published from a document with headers and child links contain header"""
     path = os.path.join(FILES_BETA, 'published3.html')
     expected = common.read_text(path)
     beta_features_tree = core.build(cwd=FILES_BETA, root=FILES_BETA)
     document_with_header = beta_features_tree.find_document('REQHEADER')
     # Act
     lines = core.publisher.publish_lines(document_with_header,
                                          '.html',
                                          linkify=True)
     text = ''.join(line + '\n' for line in lines)
     # Assert
     if CHECK_PUBLISHED_CONTENT:
         self.assertEqual(expected, text)
     common.write_text(text, path)
Ejemplo n.º 4
0
 def setUp(self):
     self.tree = core.build(cwd=FILES, root=FILES)
     # self.document = core.Document(FILES, root=ROOT)
     self.document = self.tree.find_document('REQ')
     self.temp = tempfile.mkdtemp()
Ejemplo n.º 5
0
 def test_validate_invalid_link(self):
     """Verify a tree is invalid with a bad link."""
     self.item.link('SYS003')
     tree = core.build(FILES, root=FILES)
     self.assertIsInstance(tree, core.Tree)
     self.assertFalse(tree.validate())
Ejemplo n.º 6
0
 def setUp(self):
     self.tree = core.build(cwd=FILES, root=FILES)
     # self.document = core.Document(FILES, root=ROOT)
     self.document = self.tree.find_document('REQ')
     self.temp = tempfile.mkdtemp()
Ejemplo n.º 7
0
 def test_validate_invalid_link(self):
     """Verify a tree is invalid with a bad link."""
     self.item.link('SYS003')
     tree = core.build(FILES, root=FILES)
     self.assertIsInstance(tree, core.Tree)
     self.assertFalse(tree.validate())