def __set_prefix_item(self): """Get the prefix details. Returns: prefix item or None if prefix does not exist """ self.prefix_item = get_prefix_item(self.prefix)
def test_correct_prefix_item_is_returned(app, prefixes): with app.app_context(): prefix_item = get_prefix_item("LEED") assert prefix_item == { "prefix": "LEED", "sequence_name": "heron", "formatter_class": HeronCogUkIdFormatter, "enableChildrenCreation": False, }
def test_correct_prefix_obj_is_created(app, prefixes): with app.app_context(): barcode_operations = BarcodeOperations(prefix="LEED") assert barcode_operations.prefix_item == get_prefix_item("LEED")
def test_none_is_returned_for_invalid_prefix(app): with app.app_context(): prefix_item = get_prefix_item("MOON") assert prefix_item is None
def test_correct_prefix_item_is_returned(app, prefixes): with app.app_context(): prefix_item = get_prefix_item("LEED") assert prefix_item == {"prefix": "LEED", "sequence_name": "heron", "convert": True}