parameters: (self)
docstring: Test clone
docstring_summary: Test clone
docstring_tokens: Test clone
function: def test_clone(self):
          """Test clone"""
          # empty packet
          pp2 = self.doc.clone()
          self.assertEqual(pp2 is self.doc, False, 'Failed clone')
          self.assertEqual(pp2.get_metas(), ({}, {}), 'Failed clone')
          self.assertEqual(pp2.get_attributes(), {}, 'Failed clone')
          
          # packet with attribuets
          self.doc.set('a', 1)
          self.doc.set('b', 2)
          pp3 = self.doc.clone()
          self.assertEqual(pp3 is self.doc, False, 'Failed clone')
          self.assertEqual(pp3.get_metas(), ({}, {}), 'Failed clone')
          self.assertEqual(pp3.get_attributes(), {'a': [1], 'b': [2]}, 
              'Failed clone')
          
          # packet with attribuets and meta
          self.doc.set_meta('pm1', 1)
          self.doc.set_meta('am1', 1, 'a')
          pp4 = self.doc.clone()
          self.assertEqual(pp4 is self.doc, False, 'Failed clone')
          self.assertEqual(pp4.get_metas(), ({'pm1': 1}, {'a': {'am1': 1}}), 
              'Failed clone')
          self.assertEqual(pp4.get_attributes(), {'a': [1], 'b': [2]},
              'Failed clone')
function_tokens: def test_clone ( self ) : # empty packet pp2 = self . doc . clone ( ) self . assertEqual ( pp2 is self . doc , False , 'Failed clone' ) self . assertEqual ( pp2 . get_metas ( ) , ( { } , { } ) , 'Failed clone' ) self . assertEqual ( pp2 . get_attributes ( ) , { } , 'Failed clone' ) # packet with attribuets self . doc . set ( 'a' , 1 ) self . doc . set ( 'b' , 2 ) pp3 = self . doc . clone ( ) self . assertEqual ( pp3 is self . doc , False , 'Failed clone' ) self . assertEqual ( pp3 . get_metas ( ) , ( { } , { } ) , 'Failed clone' ) self . assertEqual ( pp3 . get_attributes ( ) , { 'a' : [ 1 ] , 'b' : [ 2 ] } , 'Failed clone' ) # packet with attribuets and meta self . doc . set_meta ( 'pm1' , 1 ) self . doc . set_meta ( 'am1' , 1 , 'a' ) pp4 = self . doc . clone ( ) self . assertEqual ( pp4 is self . doc , False , 'Failed clone' ) self . assertEqual ( pp4 . get_metas ( ) , ( { 'pm1' : 1 } , { 'a' : { 'am1' : 1 } } ) , 'Failed clone' ) self . assertEqual ( pp4 . get_attributes ( ) , { 'a' : [ 1 ] , 'b' : [ 2 ] } , 'Failed clone' )