tests package

Submodules

tests.datasourcetoolbox module

Created on 2021-07-29

@author: wf

class tests.datasourcetoolbox.DataSourceTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

test for EventDataSources

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.

checkDataSource(eventDataSource: corpus.eventcorpus.EventDataSource, expectedSeries: int, expectedEvents: int, eventSample: Optional[str] = None)[source]

check the given DataSource

Parameters

eventDataSource (EventDataSource) – the event data source to check

static getEventSeries(seriesAcronym: str)[source]

Returns the event series as dict of lod (records are categorized into the different data sources)

Parameters

seriesAcronym – acronym of the series

Returns

dict of lod

inCI()[source]

are we running in a Continuous Integration Environment?

classmethod main()[source]
classmethod optionalDebug(args)[source]

start the remote debugger if the arguments specify so

Parameters

args() – The command line arguments

setUp(debug=False, profile=True, timeLimitPerTest=10.0)[source]

setUp test environment

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

tests.testConfref module

Created on 2021-08-02

@author: wf

class tests.testConfref.TestConfRef(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test getting events from Confref http://portal.confref.org as a data source

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.

setUp()[source]

setUp test environment

testConfRef()[source]

test CrossRef as an event data source

tests.testCorpusLookup module

Created on 2021-07-26

@author: wf

class tests.testCorpusLookup.TestCorpusLookup(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test the event corpus

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.

configureCorpusLookup(lookup: corpus.lookup.CorpusLookup)[source]

callback to configure the corpus lookup

setUp(debug=False, profile=True, **kwargs)[source]

setUp test environment

testDataSource4Table()[source]

test getting datasources by table name

testGetDataSourceInfos()[source]

test getting the infos for the datasources

testLookup()[source]

test the lookup

testMultiQuery()[source]

test getting entries for a given query

testViewDDL()[source]

test the view DDL

tests.testCrossRef module

Created on 2021-08-02

@author: wf

class tests.testCrossRef.TestCrossRef(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test getting events from CrossRef https://www.crossref.org/ as a data source

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.

prettyJson(d)[source]

pretty print the given jsonStr

setUp()[source]

setUp the test environment

testCrossRef()[source]

test CrossRef as an event data source

testCrossRefEventFromDOI()[source]

test creating CrossRefEvents via API

testCrossref_DOI_Lookup()[source]

test crossref API access see https://github.com/WolfgangFahl/ProceedingsTitleParser/issues/28

testFixUmlauts()[source]

workaround Umlaut issue see https://stackoverflow.com/questions/63486767/how-can-i-get-the-fuseki-api-via-sparqlwrapper-to-properly-report-a-detailed-err

tests.testDblpEvents module

Created on 28.07.2021

@author: wf

class tests.testDblpEvents.TestDblpEvents(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test the dblp data source

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.

classmethod configureCorpusLookup(lookup: corpus.lookup.CorpusLookup)[source]

callback to configure the corpus lookup

setUp(**kwargs)[source]

setup

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

testDateRange()[source]

test date Range parsing

testDblp()[source]

test getting the conference series and events from dblp xml dump

testDblpDateFix()[source]

test Dblp DateRange extraction/fixing

tests.testDblpXml module

Created on 2021-01-25

@author: wf

class tests.testDblpXml.TestDblp(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test the dblp xml parser and pylodstorage extraction for it

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.

checkConfColumn(sqlDB)[source]

check the conference columns

static getMockedDblp(mock=True, debug=False)[source]
getSqlDB(mock=True, recreate=False)[source]

get the Sql Database

log(msg)[source]
mock = True
setUp(debug: bool = False, profile: bool = True, **kwargs)[source]

setUp the test environment

especially the mocking parameter - if mock is False a multi-Gigabyte download might be activated

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testCreateSample()[source]

test creating a sample file

testDblpDownload()[source]

test dblp access

testDblpXmlParser()[source]

test parsing the xml file

testIssue5()[source]

https://github.com/WolfgangFahl/ConferenceCorpus/issues/5

dblp xml parser skips some proceedings titles

testQueries()[source]

test the parameterized query

testSqlLiteDatabaseCreation()[source]

get dict of list of dicts (tables)

testUml()[source]

test generating the uml diagram for the entities

tests.testOpenResearch module

Created on 27.07.2021

@author: wf

class tests.testOpenResearch.TestOREventManager(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

Tests OREventManager

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.

setUp(debug=False, profile=True, timeLimitPerTest=10.0)[source]

setUp test environment

test_configure()[source]

tests configuring OREventManager with different loading methods to retrieve the records from the source

test_fromWikiFileManager()[source]

tests fromWikiFileManager

test_fromWikiUser()[source]

tests fromWikiUser

test_getLodFrom()[source]

tests the different loading methods Note: the functionality is tested in depth in TestOrSMW here only te enhancing of the records is tested

test_getPropertyLookup()[source]

tests getPropertyLookup

class tests.testOpenResearch.TestOREventSeriesManager(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

Tests OREventSeriesManager

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.

setUp(debug=False, profile=True, timeLimitPerTest=10.0)[source]

setUp test environment

test_configure()[source]

tests configuring OREventManager with different loading methods to retrieve the records from the source

test_fromWikiFileManager()[source]

tests fromWikiFileManager

test_fromWikiUser()[source]

tests fromWikiUser

test_getLodFrom()[source]

tests the different loading methods Note: the functionality is tested in depth in TestOrSMW here only te enhancing of the records is tested

test_getPropertyLookup()[source]

tests getPropertyLookup

class tests.testOpenResearch.TestOpenResearch(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test the access to OpenResearch

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.

setUp(debug=False, profile=True, **kwargs)[source]

setUp test environment

testAsCsv()[source]

test csv export of events

testORDataSourceFromWikiFileManager()[source]

tests the getting conferences form wiki markup files

testORDataSourceFromWikiUser()[source]

tests initializing the OREventCorpus from wiki

class tests.testOpenResearch.TestOrSMW(methodName='runTest')[source]

Bases: tests.basetest.BaseTest

tests OrSWM

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.

setUp(debug: bool = False, profile: bool = True)[source]

setUp test environment

test_getAskQuery()[source]

tests getAskQuery

test_getAskQueryPageTitles()[source]

tests getAskQueryPageTitles

test_getLodFromWikiApi()[source]

tests getLodFromWikiApi

test_getLodFromWikiFiles()[source]

tests getLodFromWikiFiles

test_getLodFromWikiMarkup()[source]

tests getLodFromWikiMarkup

test_getLodFromWikiMarkup_queryAllEvents()[source]

tests querying all events with getLodFromWikiApi to check if the query division works

test_normalizeProperties()[source]

tests normalizeProperties

tests.testSMW module

class tests.testSMW.TestSMW[source]

Bases: object

tests functionalities of the smw package provides helper functions for other tests

classmethod getSMW_WikiUser(wikiId='or', save=False)[source]

get semantic media wiki users for SemanticMediawiki.org and openresearch.org

classmethod getWikiFileManager(wikiId=None, debug=False)[source]
classmethod getWikiUser(wikiId=None)[source]
static inPublicCI()[source]

are we running in a public Continuous Integration Environment?

wikiId = 'orclone'

tests.testStatistics module

Created on 2021-07-31

@author: wf

class tests.testStatistics.TestStatistics(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test statistics

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.

setUp(debug: bool = False, profile: bool = True, **kwargs)[source]

setUp test environment

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

testIssue255()[source]

test issue 255 problem list

testMultiQuery()[source]

test MultiQuery

testStatistics()[source]

test statistics

tests.testWebScrape module

Created on 2021-07-31

@author: wf

class tests.testWebScrape.TestWebScrape(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test getting rdfA based triples from Webpages

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.

testCrawlType()[source]

test CrawlType isValid

testWebScrape()[source]

test getting rdfA encoded info from a webpage

tests.testWikiCfp module

Created on 2021-07-31

@author: wf

class tests.testWikiCfp.TestWikiCFP(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test WikiCFP data source

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.

setUp(debug: bool = False, profile: bool = True, **kwargs)[source]

setUp test environment

testWikiCFP()[source]

test the WikiCFP lookup

tests.testWikiCfpScrape module

Created on 2020-08-20

@author: wf

class tests.testWikiCfpScrape.TestWikiCFP(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test events from WikiCFP

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.

getTempJsonDir() str[source]
handleError(ex)[source]

handle the given exception

Parameters

ex (Exception) – the exception to handle

printDelimiterCount(names)[source]

print the count of the most common used delimiters in the given name list

setUp(debug: bool = False, profile: bool = True, **kwargs)[source]

setUp test environment

testCrawlEvents()[source]

test crawling a few events and storing the result to a json file

testCrawlEventsViaCommandLine()[source]

test crawling via commandline

testCrawlFilesToJson()[source]

test getting the crawlFiles content

testCrawlType()[source]

test CrawlType enumeration

testCrawledJsonFiles()[source]

get the crawl files

testEventScraping()[source]

test scraping the given event

test “This item has been deleted” WikiCFP items

e.g. http://www.wikicfp.com/cfp/servlet/event.showcfp?eventid=3

testGettingEventSeriesForEvent()[source]

test extracting the event series id from th event page

testGettingLatestEvent()[source]

get the latest event Id with a binary search

testInvalidUrl()[source]

make sure only valid urls are accepted

testJsonPickleDateTime()[source]

test the JsonPickle datetime encoding mystery

testWikiCFP()[source]

test event handling from WikiCFP

tests.testWikidata module

Created on 27.07.2021

@author: wf

class tests.testWikidata.TestWikiData(methodName='runTest')[source]

Bases: tests.datasourcetoolbox.DataSourceTest

test wiki data access

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.

setUp(debug: bool = False, profile: bool = True, **kwargs)[source]

setUp test environment

testQueryManager()[source]

test named query usage see https://github.com/WolfgangFahl/ConferenceCorpus/issues/45

testRegExp()[source]

test Regexp handling for wikiedit

testWikidata()[source]

test getting the wikiData Event Series

Module contents