Writing tests for addons
#1
I want to write some tests for my addons. The problem seems to be that libraries such as xbmc, cbmcgui, xbmcaddon ... don't exist in a regular python environment and can't be added to the pythonpath. (I couldn't find anything in the main xbmc install that could be added)

So how do people get around this? Does anyone have xbmc addon test code they can show me?

I'm fumbling through python mock but it's a bit tricky to get my head around.
Reply
#2
A good design would be separating the scraper (or API) related code from the xbmc-related one.

Also, I suggest using xbmcswift(2) for writing plugins, xbmcswift not only mocks the XBMC modules, it also provides a CLI for development so that you can run the plugin in a console without XBMC.
My GitHub. My Add-ons:
Image
Reply
#3
For the record, I wrote a series of tests for weather.metoffice using Mock.

The biggest issue is patching out the xbmcxxx modules, done in xbmctestcase.py

https://github.com/powlo/weather.metoffi...r/src/test
Reply

Logout Mark Read Team Forum Stats Members Help
Writing tests for addons1