Esempio n. 1
0
def test_extract_example():
    parser = DocParser()
    with Path("doc_data/feefilter.txt").open() as file:
        doc_data = parser.parse(file.read())

    tester = DocTester("test_data")

    example = tester.extract_example(doc_data)
    assert example == "7cbd000000000000 ... satoshis per kilobyte: 48,508\n"
Esempio n. 2
0
 def test_example(self, path, object_name):
     name = path.name[:-4]
     if name == "intro":
         return None
     parser = DocParser()
     with path.open() as file:
         doc_data = parser.parse(file.read())
     example = self.extract_example(doc_data)
     if not example:
         return None
     if object_name and name != object_name:
         return None
     return self.test_object(name, example)