Skip to content

Commit b6edad0

Browse files
authored
Merge pull request #215 from rtibblesbot/issue-214-c5aa29
feat: add library enum constants for Kolibri and Community libraries
2 parents 311ce52 + 0c3197a commit b6edad0

5 files changed

Lines changed: 56 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Release History
22
===============
33

4+
0.2.17 Apr 13, 2026
5+
-------------------
6+
- Added library enum constants (KOLIBRI, COMMUNITY) for identifying channel library membership
7+
8+
49
0.1.33 Oct 5, 2021
510
-------------------
611
- Added new labelslookup.json constants

js/Library.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// -*- coding: utf-8 -*-
2+
// Generated by scripts/generate_from_specs.py
3+
// Library
4+
5+
export default {
6+
COMMUNITY: "COMMUNITY",
7+
KOLIBRI: "KOLIBRI",
8+
};

le_utils/constants/library.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by scripts/generate_from_specs.py
3+
from __future__ import unicode_literals
4+
5+
# Library
6+
7+
COMMUNITY = "COMMUNITY"
8+
KOLIBRI = "KOLIBRI"
9+
10+
choices = (
11+
(COMMUNITY, "Community"),
12+
(KOLIBRI, "Kolibri"),
13+
)
14+
15+
LIBRARYLIST = [
16+
COMMUNITY,
17+
KOLIBRI,
18+
]

spec/constants-library.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[
2+
"COMMUNITY",
3+
"KOLIBRI"
4+
]

tests/test_library.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from le_utils.constants import library
5+
6+
7+
def test_library_constants_exist():
8+
assert library.KOLIBRI == "KOLIBRI"
9+
assert library.COMMUNITY == "COMMUNITY"
10+
11+
12+
def test_library_choices():
13+
choices_dict = dict(library.choices)
14+
assert library.KOLIBRI in choices_dict
15+
assert library.COMMUNITY in choices_dict
16+
assert choices_dict[library.KOLIBRI] == "Kolibri"
17+
assert choices_dict[library.COMMUNITY] == "Community"
18+
19+
20+
def test_LIBRARYLIST_exists():
21+
assert library.LIBRARYLIST, "LIBRARYLIST did not generate properly"

0 commit comments

Comments
 (0)