def test_extend(self):
     a1 = Activity(id='test1', object_type='Activity')
     a2 = Activity(id='test2', object_type='Activity')
     arglist = ActivityList([a1, a2])
     alist = ActivityList([Activity(id='test3')])
     alist.extend(arglist)
     self.assertEqual(len(alist), 3)
     self.assertEqual(alist[0].id, 'test3')
     self.assertEqual(alist[1].id, 'test1')
     self.assertEqual(alist[2].id, 'test2')
 def test_extend(self):
     a1 = Activity(id='test1', object_type='Activity')
     a2 = Activity(id='test2', object_type='Activity')
     arglist = ActivityList([a1, a2])
     alist = ActivityList([Activity(id='test3')])
     alist.extend(arglist)
     self.assertEqual(len(alist), 3)
     self.assertEqual(alist[0].id, 'test3')
     self.assertEqual(alist[1].id, 'test1')
     self.assertEqual(alist[2].id, 'test2')
 def test_extendExceptionNotComponent(self):
     a1 = Activity(id='test1', object_type='Activity')
     arglist = [a1, 'not Activity']
     alist = ActivityList([Activity()])
     with self.assertRaises(TypeError):
         alist.extend(arglist)
 def test_extendExceptionNotComponent(self):
     a1 = Activity(id='test1', object_type='Activity')
     arglist = [a1, 'not Activity']
     alist = ActivityList([Activity()])
     with self.assertRaises(TypeError):
         alist.extend(arglist)