tests package¶
Submodules¶
tests.basetest module¶
Created on 2021-08-19
@author: wf
-
class
tests.basetest.Basetest(methodName='runTest')[source]¶ Bases:
unittest.case.TestCasebase test case
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
tests.testEntityManager module¶
tests.testJson module¶
Created on 2020-09-12
@author: wf
-
class
tests.testJson.ServerConfig[source]¶ Bases:
lodstorage.jsonable.JSONAble
-
class
tests.testJson.TestJsonAble(methodName='runTest')[source]¶ Bases:
tests.basetest.Basetesttest JSON serialization with JsonAble mixin
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
check(manager, manager1, listName, debugLimit)[source]¶ check that the list of the two managers are the same
-
testIssue22()[source]¶ https://github.com/WolfgangFahl/pyLoDStorage/issues/22 Regression: storeToJsonFile and restoreFromJsonFile missing in JSONAble
-
testIssue30_SampleLimited()[source]¶ tests if the json export is correctly limited to the fields that are used in the samples
-
testStoreAndRestore()[source]¶ test storing and restoring from a JSON file https://github.com/WolfgangFahl/pyLoDStorage/issues/21
-
tests.testPandas module¶
tests.testSPARQL module¶
tests.testSqlite3 module¶
Created on 2020-08-24
@author: wf
-
class
tests.testSqlite3.TestSQLDB(methodName='runTest')[source]¶ Bases:
tests.basetest.BasetestTest the SQLDB database wrapper
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
checkListOfRecords(listOfRecords, entityName, primaryKey=None, executeMany=True, fixNone=False, fixDates=False, debug=False, doClose=True)[source]¶ check the handling of the given list of Records
Parameters: - listOfRecords (list) – a list of dicts that contain the data to be stored
- entityName (string) – the name of the entity type to be used as a table name
- primaryKey (string) – the name of the key / column to be used as a primary key
- executeMany (boolean) – True if executeMany mode of sqlite3 should be used
- fixNone (boolean) – fix dict entries that are undefined to have a “None” entry
- debug (boolean) – True if debug information e.g. CREATE TABLE and INSERT INTO commands should be shown
- doClose (boolean) – True if the connection should be closed
-
testBindingError()[source]¶ test list of Records with incomplete record leading to “You did not supply a value for binding 2” see https://bugs.python.org/issue41638
-
testIssue13_setNoneValue()[source]¶ https://github.com/WolfgangFahl/pyLoDStorage/issues/13 set None value for undefined LoD entries
-
testIssue14_execute()[source]¶ https://github.com/WolfgangFahl/pyLoDStorage/issues/14
offer execute wrapper directly via sqlDB
-
testIssue15()[source]¶ https://github.com/WolfgangFahl/pyLoDStorage/issues/15
auto create view ddl in mergeschema
-
testIssue16()[source]¶ https://github.com/WolfgangFahl/pyLoDStorage/issues/16 allow to only warn if samplerecordcount is higher than number of available records
-
testIssue41()[source]¶ https://github.com/WolfgangFahl/pyLoDStorage/issues/41 improve error message when create table command fails
-
testSqllite3Speed()[source]¶ test sqlite3 speed with some 100000 artificial sample records consisting of two columns with a running index
-
testUniqueConstraint()[source]¶ test for https://github.com/WolfgangFahl/pyLoDStorage/issues/4 sqlite3.IntegrityError: UNIQUE constraint failed: … show debug info
-
tests.testTrulyTabular module¶
tests.test_Plot module¶
tests.test_Tabulate module¶
tests.test_csv module¶
-
class
tests.test_csv.TestCSV(methodName='runTest')[source]¶ Bases:
tests.basetest.BasetestTests functionalities for the conversion between csv and list od dicts (LoD)
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
testCsvFromJSONAbleExcludeFields()[source]¶ tests generation of csv from list of JSONAble object with excluding specific fields (negative list)
-
testCsvFromJSONAbleIncludeFields()[source]¶ tests generation of csv from list of JSONAble object with including only specified fields (positive list)
-
test_from_csv_without_header()[source]¶ tests if csv string without embedded headers is parsed correctly
-
test_round_trip()[source]¶ tests the csv round trip: dict -> csv -> dict Note: the inital dict has missing values it is expected that the final dict has the missing keys with None as value
-
tests.test_lod module¶
Created on 2021-06-11
@author: wf
-
class
tests.test_lod.TestLOD(methodName='runTest')[source]¶ Bases:
tests.basetest.Basetesttest list of dicts base functionality
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
-
checkHandleListTypeResult(lod, expectedLen, expected)[source]¶ check the result of the handleListType function
Parameters: - lod (list) – the list of dicts to check
- expectedLen (int) – the expected Length
- expected (str) – the expected entry for the München,Munich Q1524 record with a list
-
testGetLookupIssue31And32()[source]¶ test for https://github.com/WolfgangFahl/pyLoDStorage/issues/31 test for https://github.com/WolfgangFahl/pyLoDStorage/issues/32
-