Commit d0802e7d authored by Clément Stenac's avatar Clément Stenac

Improve test coverage

parent 711b5da2
import vlc
import unittest
import native_stats_test
class NativeStatsTestCase( unittest.TestCase ):
def testTimers( self ):
"""[Stats] Test timers"""
native_stats_test.timers_test()
......@@ -14,5 +14,5 @@ class VariablesTestCase( unittest.TestCase ):
def testSimple( self ):
"""[PyMC] Check simple add"""
assert len( self.mc.playlist_get_list() ) == 0
self.mc.playlist_add_item( "test" )
assert len( self.mc.playlist_get_list() ) == 1
# self.mc.playlist_add_item( "test" )
# assert len( self.mc.playlist_get_list() ) == 1
......@@ -17,6 +17,9 @@ static PyObject *exception_test( PyObject *self, PyObject *args )
ASSERT( libvlc_exception_get_message( &exception), "No Message" );
ASSERT( libvlc_exception_raised( &exception), "Exception not raised" );
libvlc_exception_clear( &exception );
ASSERT( !libvlc_exception_raised( &exception ), "Exception not cleared" );
Py_INCREF( Py_None );
return Py_None;
}
......@@ -52,11 +55,15 @@ static PyObject *playlist_test( PyObject *self, PyObject *args )
libvlc_exception_init( &exception );
p_instance = libvlc_new( 2, argv, &exception );
ASSERT_EXCEPTION;
/* Initial status */
libvlc_playlist_play( p_instance, 0, 0, argv, &exception );
ASSERT( libvlc_exception_raised( &exception ),
"Playlist empty and exception not raised" );
libvlc_exception_clear( &exception );
i_playing = libvlc_playlist_isplaying( p_instance, &exception );
ASSERT_EXCEPTION;
ASSERT( i_playing == 0, "Playlist shouldn't be running" );
......
#include "../pyunit.h"
#include <vlc/vlc.h>
static PyObject *timers_test( PyObject *self, PyObject *args )
{
Py_INCREF( Py_None );
return Py_None;
}
static PyMethodDef native_stats_test_methods[] = {
DEF_METHOD( timers_test, "Test timers" )
{ NULL, NULL, 0, NULL }
};
DECLARE_MODULE( native_stats_test )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment