The pluginTester module

The pluginTester module contains a class that provides the ability to test the object filters and speech rules.

The Server class

Inheritance diagram of pysiriproxy.testing.pluginTester.Server

class pysiriproxy.testing.pluginTester.Server

Create a Server Connection for testing.

Direction

Define the direction for this Connection to indicate that it is from Apple’s web server.

RefId

Define the reference ID for the server Connection.

The iPhone class

Inheritance diagram of pysiriproxy.testing.pluginTester.iPhone

class pysiriproxy.testing.pluginTester.iPhone

Create an iPhone Connection for testing.

Direction

Define the direction for this Connection to indicate that it is from the iPhone.

RefId

Define the reference ID for the iPhone Connection.

The PluginTester class

Inheritance diagram of pysiriproxy.testing.pluginTester.PluginTester

class pysiriproxy.testing.pluginTester.PluginTester(logData=None, logColor=32)[source]

The PluginTester class provides the ability to test the configured plugins for pysiriproxy. The intent is for this class to be subclassed to preform desired tests. This class provides several callback functions which can be overridden by the concrete PluginTester subclasses for specific purposes. These functions are described below:

  • iPhoneCallback() – This function is called in the event that data is being sent from the iPhone connection to the Server connection, where obj is the specific data being transmitted.
  • serverCallback() – This function is called in the event that data is being sent from the Server connection to the iPhone connection, where obj is the specific data being transmitted.
iPhoneCallback(cls, obj)[source]

The function called in the event that an object is received from the iPhone.

  • obj – The object that was received
serverCallback(cls, obj)[source]

The function called in the event that an object is received from the Server server.

  • obj – The object that was received
testFilters(obj, direction)[source]

Test the object filters for all of the configured Plugins to determine if any respond to the given object for the given direction. This function returns None if no filters were applied to this object, it returns False if this object was dropped, or it returns the object modified by the object filters.

  • obj – The object used to test filters

  • direction – The direction the object was received (either from

    the iPhone or from the Server)

testSpeech(speech)[source]

Test the speech rules for all of the configured Plugins to determine if any respond to the given speech text. This function returns True if any Plugins had speech rules that matched the given text, otherwise it returns False.

  • speech – The simulated text that was “spoken” by the user

Table Of Contents

Previous topic

The testing module

Next topic

The testSupport module

This Page