toil.test.src.realtimeLoggerTest

Module Contents

Classes

RealtimeLoggerTest

A common base class for Toil tests.

MessageDetector

Detect the secret message and set a flag.

LogTest

Class represents a unit of work in toil.

class toil.test.src.realtimeLoggerTest.RealtimeLoggerTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

digraph inheritance0d0a4522d7 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "RealtimeLoggerTest" [URL="#toil.test.src.realtimeLoggerTest.RealtimeLoggerTest",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ToilTest" -> "RealtimeLoggerTest" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TestCase" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A class whose instances are single test cases."]; "ToilTest" [URL="../../index.html#toil.test.ToilTest",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A common base class for Toil tests."]; "TestCase" -> "ToilTest" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

A common base class for Toil tests.

Please have every test case directly or indirectly inherit this one.

When running tests you may optionally set the TOIL_TEST_TEMP environment variable to the path of a directory where you want temporary test files be placed. The directory will be created if it doesn’t exist. The path may be relative in which case it will be assumed to be relative to the project root. If TOIL_TEST_TEMP is not defined, temporary files and directories will be created in the system’s default location for such files and any temporary files or directories left over from tests will be removed automatically removed during tear down. Otherwise, left-over files will not be removed.

testRealtimeLogger()[source]
class toil.test.src.realtimeLoggerTest.MessageDetector[source]

Bases: logging.StreamHandler

digraph inheritance145712a081 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Filterer" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A base class for loggers and handlers which allows them to share"]; "Handler" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Handler instances dispatch logging events to specific destinations."]; "Filterer" -> "Handler" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MessageDetector" [URL="#toil.test.src.realtimeLoggerTest.MessageDetector",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Detect the secret message and set a flag."]; "StreamHandler" -> "MessageDetector" [arrowsize=0.5,style="setlinewidth(0.5)"]; "StreamHandler" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A handler class which writes logging records, appropriately formatted,"]; "Handler" -> "StreamHandler" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Detect the secret message and set a flag.

emit(record)[source]

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an ‘encoding’ attribute, it is used to determine how to do the output to the stream.

class toil.test.src.realtimeLoggerTest.LogTest[source]

Bases: toil.job.Job

digraph inheritanced673434d32 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Job" [URL="../../../job/index.html#toil.job.Job",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class represents a unit of work in toil."]; "LogTest" [URL="#toil.test.src.realtimeLoggerTest.LogTest",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Job" -> "LogTest" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Class represents a unit of work in toil.

run(fileStore)[source]

Override this function to perform work and dynamically create successor jobs.

Parameters

fileStore – Used to create local and globally sharable temporary files and to send log messages to the leader process.

Returns

The return value of the function can be passed to other jobs by means of toil.job.Job.rv().