# HG changeset patch # User Amine Sehili # Date 1556986867 -3600 # Node ID 3cb0bbcc262d610cdad2bf1f9ddcf29db300f0d8 # Parent 368acdd0a01be005962f367bf5c4d6452668de5f Add tests for AudioRegion multiplication by exception diff -r 368acdd0a01b -r 3cb0bbcc262d tests/test_core.py --- a/tests/test_core.py Sat May 04 17:07:01 2019 +0100 +++ b/tests/test_core.py Sat May 04 17:21:07 2019 +0100 @@ -474,3 +474,13 @@ self.assertEqual(m_region.ch, 1) self.assertEqual(m_region.duration, expected_duration) self.assertEqual(len(m_region), expected_length) + + @genty_dataset( + _str=("x", "str"), + _float=(1.4, "float"), + ) + def test_multiplication_non_int(self, factor, _type): + with self.assertRaises(TypeError) as type_err: + AudioRegion(b'0' * 80, 0, 8000, 1, 1) * factor + err_msg = "Can't multiply AudioRegion by a non-int of type '{}'" + self.assertEqual(err_msg.format(_type), str(type_err.exception))