bibulous_test module

Bibulous_test.py is a script which runs through the entire Bibulous regression testing suite.

The basic approach of the tests is as follows: (1) Once a change is made to the code (to fix a bug or add functionality), the writer should add an entry to the

/test/test1.bib file, where the “entrytype” gives an indication of what the test is for. For example, the entry in the BIB file may start with

@test_initialize1{…

and provide an “author” field where one or more authors have names which the code for generating initials can potentially break is not written carefully. Include a 1-line comment about the purpose of the entry as well.

  1. If this is something which can be checked with normal options settings, then add a corresponding line in the BST file defining how that new entrytype (“test_initialize1”) should be formatted. If different options settings are needed, then a new BST file is needed. To make this, copy the “test1.bst” file, remove the entrytype definitions (you can keep them, but they would be redundant), and change the options to the needed settings. Then add a line in this file to define the entrytype template.
  2. Add a line “citation{key}” to the AUX file where “key” is the key given in the new entry of the BIB file you just put in (e.g. “test_initialize1”)
  3. Add two lines to the test1_target.bbl file (one for the “bibentry” function call, and one for the entry contents) to say what the formatted result should look like.
  4. Finally, run this script to check the result. This script will load the modified BIB and BST files and will write out a formatted BBL file “test1.bbl”. It will then try to run a “diff” program on these two files to see if there are any differences between the target and actual output BBL files.
bibulous_test.check_file_match(testnum, outputfile, targetfile)[source]
bibulous_test.run_test1()[source]

Test #1 consists of a suite of single tests of options and features that are valid with the default template file.

bibulous_test.run_test10()[source]

Test #10 checks Bibulous’ ability to sort numbers correctly (i.e. “human” sorting, so that “10” goes after, not before, “2”).

bibulous_test.run_test2()[source]

Test #2 loads a number of large .bib database files to put the BibTeX parser and the BBL file writer through a comprehensive set of conditions. Every entry in the BIB files is written to the output BBL file to test as much of the processing chain as possible.

Rather than checking the output against a target file, this test really just makes sure that no exceptions are emitted when processing the entire database through the full chain of functions.

bibulous_test.run_test3()[source]

Test #3 tests that the “authorextract” method functions correctly.

bibulous_test.run_test4()[source]

Test #4 checks the operation of generating citation keys.

bibulous_test.run_test5()[source]

Test #5 flexes the Python API.

bibulous_test.run_test6()[source]

Test #6 makes sure to raise an exception when attempting to load a BibTeX-format BST file.

bibulous_test.run_test7()[source]

Test #7 checks the operation of generating reference list labels.

bibulous_test.run_test8()[source]

Test #8 tests Bibulous’ ability to generate glossaries, symbol lists, and acronym lists.

bibulous_test.run_test9()[source]

Test #9 is a platform for running conditions in which the entire database needs to be re-read with each test.