diff --git a/CHANGELOG.md b/CHANGELOG.md index b881aa5..8010a1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Release History =============== +0.2.17 Apr 13, 2026 +------------------- + - Added library enum constants (KOLIBRI, COMMUNITY) for identifying channel library membership + + 0.1.33 Oct 5, 2021 ------------------- - Added new labelslookup.json constants diff --git a/js/Library.js b/js/Library.js new file mode 100644 index 0000000..f27eefc --- /dev/null +++ b/js/Library.js @@ -0,0 +1,8 @@ +// -*- coding: utf-8 -*- +// Generated by scripts/generate_from_specs.py +// Library + +export default { + COMMUNITY: "COMMUNITY", + KOLIBRI: "KOLIBRI", +}; diff --git a/le_utils/constants/library.py b/le_utils/constants/library.py new file mode 100644 index 0000000..f584113 --- /dev/null +++ b/le_utils/constants/library.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Generated by scripts/generate_from_specs.py +from __future__ import unicode_literals + +# Library + +COMMUNITY = "COMMUNITY" +KOLIBRI = "KOLIBRI" + +choices = ( + (COMMUNITY, "Community"), + (KOLIBRI, "Kolibri"), +) + +LIBRARYLIST = [ + COMMUNITY, + KOLIBRI, +] diff --git a/spec/constants-library.json b/spec/constants-library.json new file mode 100644 index 0000000..a407225 --- /dev/null +++ b/spec/constants-library.json @@ -0,0 +1,4 @@ +[ + "COMMUNITY", + "KOLIBRI" +] diff --git a/tests/test_library.py b/tests/test_library.py new file mode 100644 index 0000000..e773021 --- /dev/null +++ b/tests/test_library.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from le_utils.constants import library + + +def test_library_constants_exist(): + assert library.KOLIBRI == "KOLIBRI" + assert library.COMMUNITY == "COMMUNITY" + + +def test_library_choices(): + choices_dict = dict(library.choices) + assert library.KOLIBRI in choices_dict + assert library.COMMUNITY in choices_dict + assert choices_dict[library.KOLIBRI] == "Kolibri" + assert choices_dict[library.COMMUNITY] == "Community" + + +def test_LIBRARYLIST_exists(): + assert library.LIBRARYLIST, "LIBRARYLIST did not generate properly"