← Back to team overview

openlp-core team mailing list archive

Re: [Merge] lp:~mzibricky/openlp/openlyrics into lp:openlp

 

> I'm not sure I like this, I'm not a fan of changing the code just for the
> tests. In my opinion, changing the code just to add tests actually makes the
> tests useless, because they don't test the real code.

I wanted the ability to create instance of db.Manager directly without a lot of additional setup and interfering a lot with other code parts. How could I do it differently?

> 
> Can you not do things differently? What about being able to specify a config
> file for OpenLP to read from instead of the default QSettings configuration?
> That would allow us to change where stuff is stored without changing code.

The issue with QSettings is that they are global for running process (all tests are running in one process). I would have to change a lot of code in import/export settings of openlp. I didn't want to do that at this stage.

Do you have any suggestions how to easily create for tests instance of db.Manager with supplied db file and without a lot of setup?
-- 
https://code.launchpad.net/~mzibricky/openlp/openlyrics/+merge/74592
Your team OpenLP Core is subscribed to branch lp:openlp.


References