#NEWLINE# def testCommentIsFirstChildInCompound( self ) : #NEWLINE# #INDENT# code = textwrap . dedent ( '\n      if x:\n        # a comment\n        foo = 1\n      ' ) #NEWLINE# tree = pytree_utils . ParseCodeToTree ( code ) #NEWLINE# comment_splicer . SpliceComments ( tree ) #NEWLINE# if_suite = tree . children [ 0 ] . children [ 3 ] #NEWLINE# self . _AssertNodeType ( 'NEWLINE' , if_suite . children [ 0 ] ) #NEWLINE# self . _AssertNodeIsComment ( if_suite . children [ 1 ] )