Skip to content

Commit b74839e

Browse files
committed
add test case for xnuinside#65
1 parent fcac01d commit b74839e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/functional/generator/test_dataclasses.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,30 @@ class Material:
203203
"""
204204
result = create_models(ddl, models_type="dataclass")["code"]
205205
assert expected == result
206+
207+
208+
def test_default_boolean():
209+
expected = """from dataclasses import dataclass
210+
211+
212+
@dataclass
213+
class Material:
214+
215+
id: int
216+
name: str
217+
edited: bool = False
218+
deleted: bool = True
219+
"""
220+
221+
ddl = """
222+
CREATE TABLE Material
223+
(
224+
id integer,
225+
name string,
226+
edited boolean DEFAULT false,
227+
deleted boolean DEFAULT true,
228+
PRIMARY KEY (id, name)
229+
);
230+
"""
231+
result = create_models(ddl, models_type="dataclass")["code"]
232+
assert expected == result

0 commit comments

Comments
 (0)