After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 396804 - Write unit tests
Write unit tests
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: General
Git
Other Linux
: Normal enhancement
: 0.13.1
Assigned To: Pitivi maintainers
Pitivi maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-15 10:03 UTC by Edward Hervey
Modified: 2009-05-14 14:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Edward Hervey 2007-01-15 10:03:02 UTC
Currently PiTiVi is missing unit tests, we need those to be sure we don't introduce regressions and that all features work as expected.
Comment 1 Brandon Lewis 2007-03-07 02:39:54 UTC
I'd like to help with this, but I need a lot more information
Comment 2 Edward Hervey 2007-03-25 15:43:30 UTC
I think the easiest way to implement unit testing would be to use the python unittest module.

I just added an option to pitivi to be run without UI since a lot can be tested without having the UI. In fact we NEED to be able to do a lot of testing on the non-UI part of PiTiVi.

I think a first bunch of tests could be written to test the behaviour of the timeline model. Some random ideas:
* Adding sources : test all the available Composition methods for adding/inserting/pre-pending a source and see if the values after that are correct (was it properly added ? at the right place ? were the neighbours properly moved if needed ?...)
* Removing sources : test the removal of sources from a composition and check whether it was removed, were neighbours properly moved if requested ,...
* Moving sources : test all available methods for moving around sources and check if they were moved to the correct place, their start position was properly changed, the neighbours were properly moved if requested, ...

Then maybe we could start writing some unit tests for the expected behaviour when adding/removing/moving effects and transitions. We don't need to enable them at first, but it would help when writing the needed code later on.
Comment 3 Edward Hervey 2007-03-27 19:08:19 UTC
The unit test framework is now in svn:

2007-03-27  Edward Hervey  <edward@fluendo.com>

	* pitivi/pitivi.py:
	Separate the gtk mainloop handling outside of the Pitivi class.
	This allows not forcing the use of a gobject MainLoop when using
	PiTiVi.
	* Makefile.am:
	* configure.ac:
	* tests/:
	* tests/Makefile.am:
	* tests/runtests.py:
	* tests/test_basic.py:
	Added unit-test system. First provided test tests that pitivi gets
	properly created and destroyed, nothing fancy.
	This should lead the way to a whole bunch of unit-tests. Ideally we
	should have one unit test per relevant code file.

Comment 4 Edward Hervey 2007-03-27 19:09:30 UTC
Ideally, it should be possible to write unittests without having a pitivi instance. I'm thinking in particular to all the timeline/composition tests, those should be possible by creating a Timeline object and working on that.
Comment 5 Edward Hervey 2007-04-14 12:26:56 UTC
There's already a nice bunch of unit tests now, I'm closing this bug