Closed Ayan1089 closed 1 year ago
Test case and method doc-string is missing. Verified functionality with the following test case
def test_setSeeAlsoVolumes(self):
"""
tests extraction of series link over seeAlso
"""
vm = VolumeManager()
htmlText = vm.getIndexHtml(force=False)
indexParser = IndexHtmlParser(htmlText, debug=self.debug)
volumes = indexParser.parse()
expected_see_also = { # volume: expected see also list
3333: [3067],
3321: [3000, 2709],
3308: [2668, 2123, 1624, 1466, 1252, 1062, 972, 959, 672, 433, 331, 162, 110],
2298: [2035, 1909],
1609: [1391, 1180, 1179, 1178, 1177, 1176, 1175, 1174, 1173, 1172, 1171, 1170, 1169, 1168, 1167, 1166],
246: [116, 80, 56, 36, 27, 20, 12, 6]
}
for volume_number, see_also in expected_see_also.items():
with self.subTest(volume_number=volume_number, see_also=see_also):
actual_see_also = volumes.get(volume_number).get("seealso", None)
see_also = [f"Vol-{vn}" for vn in see_also]
self.assertListEqual(see_also, actual_see_also)
method functions as expected.
Great step toward test-first development.
closes #75