Index: python/lib/aubio/slicing.py
===================================================================
--- python/lib/aubio/slicing.py	(revision 8203ae591b65235eb7712944b9baf142ab25a7f4)
+++ python/lib/aubio/slicing.py	(revision aee840b6e69427658b1c80540c08da514e92836c)
@@ -6,4 +6,10 @@
         samplerate = 0,
         hopsize = 256):
+
+    if timestamps == None or len(timestamps) == 0:
+        raise ValueError ("no timestamps given")
+
+    if timestamps_end != None and len(timestamps_end) != len(timestamps):
+        raise ValueError ("len(timestamps_end) != len(timestamps)")
 
     source_base_name, source_ext = os.path.splitext(os.path.basename(source_file))
Index: python/tests/test_slicing.py
===================================================================
--- python/tests/test_slicing.py	(revision 8203ae591b65235eb7712944b9baf142ab25a7f4)
+++ python/tests/test_slicing.py	(revision aee840b6e69427658b1c80540c08da514e92836c)
@@ -6,4 +6,5 @@
 from aubio import slice_source_at_stamps
 from utils import count_samples_in_file, count_samples_in_directory
+from utils import get_default_test_sound
 
 import tempfile
@@ -13,5 +14,5 @@
 
     def setUp(self):
-        self.source_file = 'chocolate_1min.wav'
+        self.source_file = get_default_test_sound(self)
         self.output_dir = tempfile.mkdtemp(suffix = 'aubio_slicing_test_case')
 
@@ -37,4 +38,51 @@
         shutil.rmtree(self.output_dir)
 
+class aubio_slicing_wrong_starts_test_case(TestCase):
+
+    def setUp(self):
+        self.source_file = get_default_test_sound(self)
+        self.output_dir = tempfile.mkdtemp(suffix = 'aubio_slicing_test_case')
+
+    def test_slice_start_empty(self):
+        regions_start = []
+        self.assertRaises(ValueError,
+                slice_source_at_stamps,
+                self.source_file, regions_start, output_dir = self.output_dir)
+
+    def test_slice_start_none(self):
+        regions_start = None
+        self.assertRaises(ValueError,
+                slice_source_at_stamps,
+                self.source_file, regions_start, output_dir = self.output_dir)
+
+    def tearDown(self):
+        shutil.rmtree(self.output_dir)
+
+class aubio_slicing_wrong_ends_test_case(TestCase):
+
+    def setUp(self):
+        self.source_file = get_default_test_sound(self)
+        self.output_dir = tempfile.mkdtemp(suffix = 'aubio_slicing_test_case')
+
+    def test_slice_wrong_ends(self):
+        regions_start = [i*1000 for i in range(1, 100)]
+        regions_end = []
+        self.assertRaises (ValueError,
+            slice_source_at_stamps, self.source_file, regions_start, regions_end,
+                output_dir = self.output_dir)
+
+    def test_slice_no_ends(self):
+        regions_start = [i*1000 for i in range(1, 100)]
+        regions_end = None
+        slice_source_at_stamps (self.source_file, regions_start, regions_end,
+                output_dir = self.output_dir)
+        original_samples = count_samples_in_file(self.source_file)
+        written_samples = count_samples_in_directory(self.output_dir)
+        assert_equal(original_samples, written_samples,
+            "number samples written different from number of original samples")
+
+    def tearDown(self):
+        shutil.rmtree(self.output_dir)
+
 if __name__ == '__main__':
     from unittest import main
Index: python/tests/utils.py
===================================================================
--- python/tests/utils.py	(revision 8203ae591b65235eb7712944b9baf142ab25a7f4)
+++ python/tests/utils.py	(revision aee840b6e69427658b1c80540c08da514e92836c)
@@ -12,4 +12,11 @@
     datadir = os.path.join(os.path.dirname(__file__), rel_dir)
     return glob.glob(os.path.join(datadir,'*.*'))
+
+def get_default_test_sound(TestCase, rel_dir = 'sounds'):
+    all_sounds = list_all_sounds(rel_dir)
+    if len(all_sounds) == 0:
+        TestCase.skipTest("please add some sounds in \'python/tests/sounds\'")
+    else:
+        return all_sounds[0]
 
 def array_from_yaml_file(filename):
