def test_paths(self, tmpdir): move_to_temp(tmpdir, 'test_document.log') document = Document("test_document", tmpdir.strpath) pdf_path = os.path.join(tmpdir.strpath, 'test_document.pdf') log_path = os.path.join(tmpdir.strpath, 'test_document.log') assert document.pdf_path() == pdf_path assert document.log_path() == log_path
def explore_documents(self): root = self.output for owner in os.listdir(root): for repository in os.listdir(os.path.join(root, owner)): for file in os.listdir(os.path.join(root, owner, repository)): path = os.path.join(root, owner, repository) name = os.path.splitext(file)[0] identifier = Identifier(owner, repository, name) try: document = Document(name, path) self.submit_document(identifier, document) logging.info("Document %s found on disk", identifier) except RuntimeError: pass
def _submit_documents(self): document = Document(self.identifier.name, self.build.path) document.move_to(self.document_directory) self.build_manager.submit_document(self.identifier, document) self.build.finish()
def test_read_warnings(self, tmpdir): move_to_temp(tmpdir, 'test_document.log') document = Document("test_document", tmpdir.strpath) assert len(document.get_warnings()) == 5
def test_read_lines(self, tmpdir): move_to_temp(tmpdir, 'test_document.log') document = Document("test_document", tmpdir.strpath) assert len(document._lines)
def test_constructor2(self, tmpdir): move_to_temp(tmpdir, 'test_document.log') Document("test_document", tmpdir.strpath) assert True
def test_constructor1(self): with pytest.raises(RuntimeWarning): Document("test", "")