+#
+# Copyright (C) 2019 EfficiOS Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; only version 2
+# of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
import unittest
import uuid
import copy
import bt2
+@unittest.skip("this is broken")
class CtfWriterClockTestCase(unittest.TestCase):
def setUp(self):
self._clock = bt2.CtfWriterClock('salut')
+ def tearDown(self):
+ del self._clock
+
def test_create_default(self):
self.assertEqual(self._clock.name, 'salut')
def test_create_full(self):
my_uuid = uuid.uuid1()
- cc = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
+ cc = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
self.assertEqual(cc.name, 'name')
self.assertEqual(cc.description, 'some description')
self.assertEqual(cc.frequency, 1001)
def test_eq(self):
my_uuid = uuid.uuid1()
- cc1 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
+ cc1 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
self.assertEqual(cc1, cc2)
def test_ne_name(self):
my_uuid = uuid.uuid1()
- cc1 = bt2.CtfWriterClock(name='mane', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
+ cc1 = bt2.CtfWriterClock(
+ name='mane',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
self.assertNotEqual(cc1, cc2)
def test_ne_description(self):
my_uuid = uuid.uuid1()
- cc1 = bt2.CtfWriterClock(name='name', description='some descripti2',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
+ cc1 = bt2.CtfWriterClock(
+ name='name',
+ description='some descripti2',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
self.assertNotEqual(cc1, cc2)
def test_ne_frequency(self):
my_uuid = uuid.uuid1()
- cc1 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1003, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
+ cc1 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1003,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
self.assertNotEqual(cc1, cc2)
def test_ne_precision(self):
my_uuid = uuid.uuid1()
- cc1 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=171,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
+ cc1 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=171,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
self.assertNotEqual(cc1, cc2)
def test_ne_offset(self):
my_uuid = uuid.uuid1()
- cc1 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3001),
- is_absolute=True, uuid=my_uuid)
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
+ cc1 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3001),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
self.assertNotEqual(cc1, cc2)
def test_ne_absolute(self):
my_uuid = uuid.uuid1()
- cc1 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=my_uuid)
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=False, uuid=my_uuid)
+ cc1 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=my_uuid,
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=False,
+ uuid=my_uuid,
+ )
self.assertNotEqual(cc1, cc2)
def test_ne_uuid(self):
- cc1 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=uuid.uuid1())
- cc2 = bt2.CtfWriterClock(name='name', description='some description',
- frequency=1001, precision=176,
- offset=bt2.ClockClassOffset(45, 3003),
- is_absolute=True, uuid=uuid.uuid1())
+ cc1 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=uuid.uuid1(),
+ )
+ cc2 = bt2.CtfWriterClock(
+ name='name',
+ description='some description',
+ frequency=1001,
+ precision=176,
+ offset=bt2.ClockClassOffset(45, 3003),
+ is_absolute=True,
+ uuid=uuid.uuid1(),
+ )
self.assertNotEqual(cc1, cc2)
def test_eq_invalid(self):