@@ -51,6 +51,77 @@ def test_mk_create_table_ddl(self):
51
51
");\n "
52
52
)
53
53
self .assertEqual (mk_create_table_ddl (table_name , columns ), expected_output )
54
+
55
+ def test_mk_create_table_ddl_spaces (self ):
56
+ table_name = "table1"
57
+ columns = [
58
+ {
59
+ "data_type" : "text" ,
60
+ "column_name" : "Invoice Number" ,
61
+ "column_description" : "Unique identifier for each invoice"
62
+ },
63
+ {
64
+ "data_type" : "text" ,
65
+ "column_name" : "Invoice Date" ,
66
+ "column_description" : "Date when the invoice was issued"
67
+ },
68
+ {
69
+ "data_type" : "text" ,
70
+ "column_name" : "Sales Order#" ,
71
+ "column_description" : "Sales order number associated with the invoice"
72
+ },
73
+ {
74
+ "data_type" : "text" ,
75
+ "column_name" : "Customer Name" ,
76
+ "column_description" : "Name of the customer who made the purchase"
77
+ },
78
+ {
79
+ "data_type" : "int" ,
80
+ "column_name" : "Total with out GST" ,
81
+ "column_description" : "Total amount of the invoice without including GST"
82
+ },
83
+ {
84
+ "data_type" : "int" ,
85
+ "column_name" : "Total" ,
86
+ "column_description" : "Total amount of the invoice including GST"
87
+ },
88
+ {
89
+ "data_type" : "text" ,
90
+ "column_name" : "Status" ,
91
+ "column_description" : "Current status of the invoice"
92
+ },
93
+ {
94
+ "data_type" : "text" ,
95
+ "column_name" : "Salesperson Name" ,
96
+ "column_description" : "Name of the salesperson who handled the sale"
97
+ },
98
+ {
99
+ "data_type" : "text" ,
100
+ "column_name" : "Account Type" ,
101
+ "column_description" : "Type of account associated with the invoice"
102
+ },
103
+ {
104
+ "data_type" : "text" ,
105
+ "column_name" : "Item Category" ,
106
+ "column_description" : "Category of the item purchased"
107
+ }
108
+ ]
109
+ expected_output = (
110
+ "CREATE TABLE table1 (\n "
111
+ " \" Invoice Number\" text, --Unique identifier for each invoice\n "
112
+ " \" Invoice Date\" text, --Date when the invoice was issued\n "
113
+ " \" Sales Order#\" text, --Sales order number associated with the invoice\n "
114
+ " \" Customer Name\" text, --Name of the customer who made the purchase\n "
115
+ " \" Total with out GST\" integer, --Total amount of the invoice without including GST\n "
116
+ " Total integer, --Total amount of the invoice including GST\n "
117
+ " Status text, --Current status of the invoice\n "
118
+ " \" Salesperson Name\" text, --Name of the salesperson who handled the sale\n "
119
+ " \" Account Type\" text, --Type of account associated with the invoice\n "
120
+ " \" Item Category\" text --Category of the item purchased\n "
121
+ ");\n "
122
+ )
123
+ self .assertEqual (mk_create_table_ddl (table_name , columns ), expected_output )
124
+
54
125
55
126
56
127
class TestMkCreateDDL (unittest .TestCase ):
0 commit comments