sql-testing-tools 0.2.5__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/PKG-INFO +4 -1
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/README.md +3 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/setup.py +1 -1
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools/Helper.py +6 -95
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools.egg-info/PKG-INFO +4 -1
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/setup.cfg +0 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools/BaseAccess.py +0 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools/TokenProcessing.py +0 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools/__init__.py +0 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools.egg-info/SOURCES.txt +0 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools.egg-info/dependency_links.txt +0 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools.egg-info/requires.txt +0 -0
- {sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: sql_testing_tools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Requires-Dist: sqlparse>=0.5.1
|
|
6
6
|
Requires-Dist: requests>=2.32.3
|
|
@@ -136,6 +136,9 @@ res = checkEquality()
|
|
|
136
136
|
|
|
137
137
|
### Changelog
|
|
138
138
|
|
|
139
|
+
##### V 0.2.6
|
|
140
|
+
- Fixed bug in checkKeywords: if keyword was present in one query and not in the other, the comparison was not performed correctly.
|
|
141
|
+
|
|
139
142
|
##### V 0.2.5
|
|
140
143
|
- Added support for [dbiu.de](https://www.datenbanken-im-unterricht.de/catalog.php) databases 1-18 (loaded via [dbiu_databases](https://github.com/ValentinHerrmann/dbiu_databases)) with option to still load DBs from local repo.
|
|
141
144
|
- Improved docs
|
|
@@ -126,6 +126,9 @@ res = checkEquality()
|
|
|
126
126
|
|
|
127
127
|
### Changelog
|
|
128
128
|
|
|
129
|
+
##### V 0.2.6
|
|
130
|
+
- Fixed bug in checkKeywords: if keyword was present in one query and not in the other, the comparison was not performed correctly.
|
|
131
|
+
|
|
129
132
|
##### V 0.2.5
|
|
130
133
|
- Added support for [dbiu.de](https://www.datenbanken-im-unterricht.de/catalog.php) databases 1-18 (loaded via [dbiu_databases](https://github.com/ValentinHerrmann/dbiu_databases)) with option to still load DBs from local repo.
|
|
131
134
|
- Improved docs
|
|
@@ -152,7 +152,7 @@ def buildAndSendCosetteRequest(baseDict, sql, sol):
|
|
|
152
152
|
def checkKeywords(startWord:str, endWords:list):
|
|
153
153
|
global sql,sol
|
|
154
154
|
|
|
155
|
-
if(startWord not in sol
|
|
155
|
+
if(startWord not in sol and startWord not in sql):
|
|
156
156
|
return ""
|
|
157
157
|
|
|
158
158
|
if(startWord in sql):
|
|
@@ -186,119 +186,30 @@ def checkKeywords(startWord:str, endWords:list):
|
|
|
186
186
|
return "Der '"+startWord+"' Teil der SQL-Abfrage ist nicht korrekt (oder nicht automatisch überprüfbar)."
|
|
187
187
|
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
191
189
|
def checkColumns(sqlPath="", solPath=""):
|
|
192
190
|
global sql,sol
|
|
193
191
|
setup(sqlPath, solPath)
|
|
194
192
|
return checkKeywords("SELECT", ["FROM", "WHERE", "GROUP BY", "ORDER BY", "LIMIT", ";", "HAVING"])
|
|
195
193
|
|
|
196
194
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if("SELECT" in sql and "FROM" in sql):
|
|
200
|
-
start = str.find(sql, "SELECT")
|
|
201
|
-
end = str.find(sql, "FROM")
|
|
202
|
-
submission = str.strip(sql[start:end])
|
|
203
|
-
print("'"+submission+"'")
|
|
204
|
-
|
|
205
|
-
start = str.find(sol, "SELECT")
|
|
206
|
-
end = str.find(sol, "FROM")
|
|
207
|
-
solution = str.strip(sol[start:end])
|
|
208
|
-
print("'"+solution+"'")
|
|
209
|
-
|
|
210
|
-
if submission == solution:
|
|
211
|
-
return ""
|
|
212
|
-
return "Ausgegebene Spalten sind nicht korrekt (oder nicht automatisch überprüfbar)."
|
|
213
|
-
|
|
214
195
|
def checkTables(sqlPath="", solPath=""):
|
|
215
196
|
global sql,sol
|
|
216
197
|
setup(sqlPath, solPath)
|
|
217
198
|
return checkKeywords("FROM", ["FROM", "WHERE", "GROUP BY", "ORDER BY", "LIMIT", ";", "HAVING"])
|
|
218
199
|
|
|
219
200
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if("SELECT" in sql and "FROM" in sql):
|
|
223
|
-
endFromKeywords = ["WHERE", "GROUP", "ORDER", "LIMIT", ";"]
|
|
224
|
-
|
|
225
|
-
start = str.find(sql, "FROM")
|
|
226
|
-
end = -1
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
for keyword in endFromKeywords:
|
|
230
|
-
if(str.find(sql, keyword) != -1):
|
|
231
|
-
end = str.find(sql, keyword)
|
|
232
|
-
break
|
|
233
|
-
if(end == -1):
|
|
234
|
-
end = len(sql)
|
|
235
|
-
|
|
236
|
-
submission = str.strip(sql[start:end])
|
|
237
|
-
print("'"+submission+"'")
|
|
238
|
-
|
|
239
|
-
start = str.find(sol, "FROM")
|
|
240
|
-
end = -1
|
|
241
|
-
|
|
242
|
-
for keyword in endFromKeywords:
|
|
243
|
-
if(str.find(sol, keyword) != -1):
|
|
244
|
-
end = str.find(sol, keyword)
|
|
245
|
-
break
|
|
246
|
-
if(end == -1):
|
|
247
|
-
end = len(sol)
|
|
248
|
-
|
|
249
|
-
solution = str.strip(sol[start:end])
|
|
250
|
-
print("'"+solution+"'")
|
|
251
|
-
|
|
252
|
-
if submission == solution:
|
|
253
|
-
return ""
|
|
254
|
-
return "Verwendete Tabellen sind nicht korrekt (oder nicht automatisch überprüfbar)."
|
|
255
|
-
|
|
256
201
|
def checkCondition(sqlPath="", solPath=""):
|
|
257
202
|
global sql,sol
|
|
258
203
|
setup(sqlPath, solPath)
|
|
259
204
|
return checkKeywords("WHERE", ["GROUP BY", "ORDER BY", "LIMIT", ";", "HAVING"])
|
|
260
205
|
|
|
206
|
+
|
|
261
207
|
def checkOrder(sqlPath="", solPath=""):
|
|
262
208
|
global sql,sol
|
|
263
209
|
setup(sqlPath, solPath)
|
|
264
210
|
return checkKeywords("ORDER BY", ["WHERE", "GROUP BY", "ORDER BY", "LIMIT", ";", "HAVING"])
|
|
265
211
|
|
|
266
212
|
|
|
267
|
-
|
|
268
|
-
if("ORDER BY" in sql):
|
|
269
|
-
endFromKeywords = ["WHERE", "GROUP", "LIMIT", ";"]
|
|
270
|
-
|
|
271
|
-
start = str.find(sql, "ORDER BY")
|
|
272
|
-
end = -1
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
for keyword in endFromKeywords:
|
|
276
|
-
if(str.find(sql, keyword) != -1):
|
|
277
|
-
end = str.find(sql, keyword)
|
|
278
|
-
break
|
|
279
|
-
if(end == -1):
|
|
280
|
-
end = len(sql)
|
|
281
|
-
|
|
282
|
-
submission = str.strip(sql[start:end])
|
|
283
|
-
print("'"+submission+"'")
|
|
284
|
-
|
|
285
|
-
start = str.find(sol, "ORDER BY")
|
|
286
|
-
end = -1
|
|
287
|
-
|
|
288
|
-
for keyword in endFromKeywords:
|
|
289
|
-
if(str.find(sol, keyword) != -1):
|
|
290
|
-
end = str.find(sol, keyword)
|
|
291
|
-
break
|
|
292
|
-
if(end == -1):
|
|
293
|
-
end = len(sol)
|
|
294
|
-
|
|
295
|
-
solution = str.strip(sol[start:end])
|
|
296
|
-
print("'"+solution+"'")
|
|
297
|
-
|
|
298
|
-
if submission == solution:
|
|
299
|
-
return ""
|
|
300
|
-
return "Die Sortierung ist nicht korrekt (oder nicht automatisch überprüfbar)."
|
|
301
|
-
|
|
302
213
|
def checkGroup(sqlPath="", solPath=""):
|
|
303
214
|
global sql,sol
|
|
304
215
|
setup(sqlPath, solPath)
|
|
@@ -306,17 +217,17 @@ def checkGroup(sqlPath="", solPath=""):
|
|
|
306
217
|
|
|
307
218
|
|
|
308
219
|
def checkEquality(sqlPath="", solPath=""):
|
|
309
|
-
global sql,sol
|
|
220
|
+
global sql, sol
|
|
310
221
|
setup(sqlPath, solPath)
|
|
311
222
|
|
|
312
|
-
if
|
|
223
|
+
if sql == sol:
|
|
313
224
|
return ""
|
|
314
225
|
|
|
315
226
|
result = buildAndSendCosetteRequest(bd, sql, sol)
|
|
316
227
|
|
|
317
|
-
if
|
|
228
|
+
if result[0] == "ERR":
|
|
318
229
|
return "\n\nFehler bei der automatischen Überprüfung der Abgabe. Es kann keine Aussage über die Korrektheit der Abgabe getroffen werden."
|
|
319
|
-
elif
|
|
230
|
+
elif result[0] != "EQ":
|
|
320
231
|
return "\n\nDie Abgabe stimmt nicht mit der Musterlösung überein."
|
|
321
232
|
return ""
|
|
322
233
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: sql_testing_tools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Description-Content-Type: text/markdown
|
|
5
5
|
Requires-Dist: sqlparse>=0.5.1
|
|
6
6
|
Requires-Dist: requests>=2.32.3
|
|
@@ -136,6 +136,9 @@ res = checkEquality()
|
|
|
136
136
|
|
|
137
137
|
### Changelog
|
|
138
138
|
|
|
139
|
+
##### V 0.2.6
|
|
140
|
+
- Fixed bug in checkKeywords: if keyword was present in one query and not in the other, the comparison was not performed correctly.
|
|
141
|
+
|
|
139
142
|
##### V 0.2.5
|
|
140
143
|
- Added support for [dbiu.de](https://www.datenbanken-im-unterricht.de/catalog.php) databases 1-18 (loaded via [dbiu_databases](https://github.com/ValentinHerrmann/dbiu_databases)) with option to still load DBs from local repo.
|
|
141
144
|
- Improved docs
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sql_testing_tools-0.2.5 → sql_testing_tools-0.2.6}/sql_testing_tools.egg-info/top_level.txt
RENAMED
|
File without changes
|