Skip to content

Update Mockup for Pytest for items, plugins and provide basic test case for sample Plugin #361

@bmxp

Description

@bmxp

As SmartHomeNG grows the possibility for errors increases. We should consider to provide tests within the sample plugin thus plugin developers can write tests for their functions.
Before releasing test code within sample plugin, we need to overhaul the mockup of core, plugins, items and logics.
@ohinckel did an amazing job with the database tests. Unfortunately quite a number of tests did not work after core refactoring.
Especially the possibility to create a plugin with a simple call does not work since the data for plugin is read within the core and not passed upon creation any more.

Example Init function of the current SamplePlugin:

def __init__(self, sh):

Old Plugins used to have an init function like:

def __init__(self, smarthome, time_ga=None, date_ga=None, send_time=False, busmonitor=False, host='127.0.0.1', port=6720, readonly=False, instance='default', enable_stats = True):

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreIssue relates to the core of SmartomeNGhelp wantedpluginsIssue relates to a plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions