Skip to content

Commit 4b297a2

Browse files
authored
Added tests
1 parent 4247151 commit 4b297a2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

graphene/types/tests/test_enum.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ def test_enum_from_builtin_enum():
6464
assert RGB.GREEN
6565
assert RGB.BLUE
6666

67+
def test_enum_custom_description_in_constructor():
68+
description = "An enumeration, but with a custom description"
69+
RGB = Enum(
70+
"RGB",
71+
"RED,GREEN,BLUE",
72+
description=description,
73+
)
74+
assert RGB._meta.description == description
75+
76+
77+
def test_enum_from_python3_enum_uses_default_builtin_doc():
78+
RGB = Enum("RGB", "RED,GREEN,BLUE")
79+
assert RGB._meta.description == "An enumeration."
6780

6881
def test_enum_from_builtin_enum_accepts_lambda_description():
6982
def custom_description(value):

0 commit comments

Comments
 (0)