File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1
1
from ..enum import Enum , PyEnum
2
+ from ..field import Field
3
+ from ..inputfield import InputField
4
+ from ..argument import Argument
2
5
3
6
4
7
def test_enum_construction ():
@@ -72,3 +75,39 @@ class RGB(Enum):
72
75
assert RGB .RED .value == 1
73
76
assert RGB .GREEN .value == 2
74
77
assert RGB .BLUE .value == 3
78
+
79
+
80
+ def test_enum_value_as_unmounted_field ():
81
+ class RGB (Enum ):
82
+ RED = 1
83
+ GREEN = 2
84
+ BLUE = 3
85
+
86
+ unmounted = RGB ()
87
+ unmounted_field = unmounted .Field ()
88
+ assert isinstance (unmounted_field , Field )
89
+ assert unmounted_field .type == RGB
90
+
91
+
92
+ def test_enum_value_as_unmounted_inputfield ():
93
+ class RGB (Enum ):
94
+ RED = 1
95
+ GREEN = 2
96
+ BLUE = 3
97
+
98
+ unmounted = RGB ()
99
+ unmounted_field = unmounted .InputField ()
100
+ assert isinstance (unmounted_field , InputField )
101
+ assert unmounted_field .type == RGB
102
+
103
+
104
+ def test_enum_value_as_unmounted_argument ():
105
+ class RGB (Enum ):
106
+ RED = 1
107
+ GREEN = 2
108
+ BLUE = 3
109
+
110
+ unmounted = RGB ()
111
+ unmounted_field = unmounted .Argument ()
112
+ assert isinstance (unmounted_field , Argument )
113
+ assert unmounted_field .type == RGB
You can’t perform that action at this time.
0 commit comments