Exemple #1
0
    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)
Exemple #2
0
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,
        }
Exemple #3
0
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")
Exemple #4
0
def test_none_is_returned_for_invalid_prefix(app):
    with app.app_context():
        prefix_item = get_prefix_item("MOON")
        assert prefix_item is None
Exemple #5
0
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}