PluginTest(self, methodName='runTest')
PluginTest.load_plugin(self, plugin_class)
Returns Plugin Instance (object). Works for both callable classes or methods.
Adds method run(string) - which execute plugin using mocked api.
PluginTest.queue_input(self, msg)
Queue msg to be returned by 'jarvis.input()'
PluginTest.histroy_call(self)
Returns MockHistory instance. Fields:
- operation (string)
- args (tuple)
- return value
PluginTest.history_say(self)
Returns MockHistory instance. Fields:
- text (string)
- color (colorama.Fore.*)
PluginTest.history_notification(self)
Returns MockHistory instance. Fields:
- msg (string)
- time_seconds (int)
PluginTest.history_schedule(self)
Returns MockHistory instance. Fields:
- time_seconds (int)
- function
- args (tuple)
MockHistory(self)
Record/Output history.
Recorded data sets must contain fixed and predefined number of "fields" (e.g. text and color).
Note: For Methods with first parameter "field" method "name_field" exist. So "view('text')" can be rewritten as "view_text".
MockHistory.record(self, *args)
Do not call manually!
MockHistory.contains(self, field=None, value=None)
Check if value is recorded. If field is None, value should be a tuple of values for all fields.
MockHistory.view(self, field=None, index=None)
Returns value.
If field is None, returns tuple of all values for all fields. If index is None, returns all recorded values
MockHistory.last(self, field=None)
Shortcut for view with index -1
MockHistory.get_length(self)
Returns how many data sets were recorded