cjklib.test.readingoperator — Unit tests for reading.operator

Unit tests for cjklib.reading.operator.

Classes

class cjklib.test.readingoperator.CanoneseIPAOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

cleanDecomposition(decomposition, reading, **options)
testBaseExplicitTones()
Test if the tones reported by getBaseTone() and getExplicitTone() are valid.
testEntityCountConstant()
Test if the number of reading entities reported by getReadingEntities() is constant between different stop tone realisations.
testReportedToneValid()
Test if the tone reported by splitEntityTone() is valid for the given entity.
static testUpperCase(dialect)
class cjklib.test.readingoperator.CanoneseYaleOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

class cjklib.test.readingoperator.CantoneseYaleOperatorReferenceTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorReferenceTest, unittest.TestCase

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.

class cjklib.test.readingoperator.GROperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

cleanDecomposition(decomposition, reading, **options)
testAbbreviatedEntitiesConsistency()
Test if all abbreviated reading entities returned by getAbbreviatedEntities() are accepted by isAbbreviatedEntity().
testRhotacisedEntitesBackConversion()
Test if complement methods getBaseEntitiesForRhotacised() and getRhotacisedTonalEntity() are consistent.
static testUpperCase(dialect)
testValidAbbreviatedEntitiesAccepted()
Test if all abbreviated reading entities returned by getAbbreviatedEntities() are accepted by isAbbreviatedEntity().
class cjklib.test.readingoperator.GROperatorReferenceTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorReferenceTest, unittest.TestCase

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.

INITIAL_MAPPING
Mapping of Pinyin intials to GR ones.
setUp()
testAbbreviatedEntitiesReferences()
Test if abbreviated reading entity references are accepted by isAbbreviatedEntity().
testGRJunctionTable()
Test if all GR syllables have a reference given.
class cjklib.test.readingoperator.HangulOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

class cjklib.test.readingoperator.HangulOperatorReferenceTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorReferenceTest, unittest.TestCase

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.

class cjklib.test.readingoperator.HiraganaOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

class cjklib.test.readingoperator.JyutpingOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

class cjklib.test.readingoperator.JyutpingOperatorReferenceTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorReferenceTest, unittest.TestCase

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.

class cjklib.test.readingoperator.KanaOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

class cjklib.test.readingoperator.KatakanaOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

class cjklib.test.readingoperator.MandarinBrailleOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

class cjklib.test.readingoperator.MandarinIPAOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

cleanDecomposition(decomposition, reading, **options)
static testUpperCase(dialect)
class cjklib.test.readingoperator.PinyinOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

cleanDecomposition(decomposition, reading, **options)
static noToneApostropheRule(operatorInst, precedingEntity, followingEntity)
class cjklib.test.readingoperator.PinyinOperatorReferenceTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorReferenceTest, unittest.TestCase

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.

testStrictDecompositionReferences()
Test if the given decomposition references pass strictness test.
class cjklib.test.readingoperator.ReadingOperatorConsistencyTest

Bases: cjklib.test.readingoperator.ReadingOperatorTest

Base class for consistency testing of ReadingOperator classes.

DIALECTS
Dialects tested additionally to the standard one. Given as list of dictionaries holding the dialect’s options.
testDecomposeIsIdentityForSingleEntity()
Test if all reading entities returned by getReadingEntities() are decomposed into the single entity again.
testDecomposeKeepsSyllablePairs()
Test if all pairs of reading entities returned by getReadingEntities() are decomposed into the same pairs again and possibly are strict.
testDefaultOptions()
Test if option dict returned by getDefaultOptions() is well-formed and includes all options found in the test case’s options.
testGetTonalEntityOfSplitEntityToneIsIdentity()
Test if the composition of getTonalEntity() and splitEntityTone() returns the original value for all entities returned by getReadingEntities().
testGuessReadingDialect()
Test if option dict returned by guessReadingDialect() is well-formed and options are included in dict from getDefaultOptions().
testInstantiation()
Test if given dialects can be instantiated.
testOnsetRhyme()
Test if all plain entities are accepted by getOnsetRhyme().
testReadingCharacters()
Test if set returned by getReadingCharacters() is well-formed and includes all characters found in reading entities.
testReadingNameUnique()
Test if only one ReadingOperator exists for each reading.
testSplitEntityToneReturnsValidInformation()
Test if splitEntityTone() returns a valid plain entity and a valid tone for all entities returned by getReadingEntities().
testValidFormattingEntitiesAccepted()
Test if all formatting entities returned by getFormattingEntities() are accepted by isFormattingEntity().
testValidPlainReadingEntitiesAccepted()
Test if all plain reading entities returned by getPlainReadingEntities() are accepted by isPlainReadingEntity().
testValidReadingEntitiesAccepted()
Test if all reading entities returned by getReadingEntities() are accepted by isReadingEntity().
class cjklib.test.readingoperator.ReadingOperatorReferenceTest

Bases: cjklib.test.readingoperator.ReadingOperatorTest

Base class for testing of references against ReadingOperator classes. These tests assure that the given values are returned correctly.

COMPOSITION_REFERENCES
References to test compose() operation. List of dialect/reference tuples, schema: ({}, [(reference, target)])
DECOMPOSITION_REFERENCES
References to test decompose() operation. List of dialect/reference tuples, schema: ({dialect}, [(reference, target)])
GUESS_DIALECT_REFERENCES
References to test guessReadingDialect() operation. List of reference/dialect tuples, schema: (reference, {})
READING_ENTITY_REFERENCES
References to test isReadingEntity() operation. List of dialect/reference tuples, schema: ({}, [(reference, target)])
testCompositionReferences()
Test if the given composition references are reached.
testDecompositionReferences()
Test if the given decomposition references are reached.
testEntityReferences()
Test if the given entity references are accepted/rejected.
testGuessDialectReferences()
Test if guessReadingDialect() guesses the needed options.
class cjklib.test.readingoperator.ReadingOperatorTest

Bases: cjklib.test.NeedsDatabaseTest

Base class for testing of ReadingOperator classes.

READING_NAME
Name of reading to test
setUp()
shortDescription()
tearDown()
class cjklib.test.readingoperator.ReadingOperatorTestCaseCheck(methodName='runTest')

Bases: cjklib.test.NeedsDatabaseTest, unittest.TestCase

Checks if every ReadingOperator has its own ReadingOperatorConsistencyTest.

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.

static getReadingOperatorConsistencyTestClasses()

Gets all classes implementing cjklib.test.readingoperator.ReadingOperatorConsistencyTest.

Return type:list
Returns:list of all classes inheriting form cjklib.test.readingoperator.ReadingOperatorConsistencyTest
testEveryOperatorHasConsistencyTest()
Check if every reading has a test case.
class cjklib.test.readingoperator.WadeGilesOperatorConsistencyTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorConsistencyTest, unittest.TestCase

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.

cleanDecomposition(decomposition, reading, **options)
class cjklib.test.readingoperator.WadeGilesOperatorReferenceTest(methodName='runTest')

Bases: cjklib.test.readingoperator.ReadingOperatorReferenceTest, unittest.TestCase

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.