示例#1
0
    def test_Parse(self):
        text = """data_no_comments_here

save_comment
   _Saveframe_category  comment
   loop_
        _comment
        _every_flag
        _category

'#It has very upfield-shifted H5', H5" @ 3.935,4.012 ppm'
;
#######################
#  BOGUS              #
#######################

;

    BOGUS_CATEGORY

     stop_
save_
"""
        self.assertFalse(self.strf.parse(text=text))
        st = self.strf.star_text()
        #            print "unparsed text:[" +st+ "]"

        exp = """data_no_comments_here
save_comment   _Saveframe_category  comment   loop_
        _comment
        _every_flag
        _category
;
#It has very upfield-shifted H5', H5" @ 3.935,4.012 ppm
;
;
#######################
#  BOGUS              #
#######################

;    BOGUS_CATEGORY     stop_ save_
"""
        self.assertTrue(Utils.equalIgnoringWhiteSpace(exp, st))
示例#2
0
    def test_Parse(self):
        text = """data_no_comments_here

save_comment
   _Saveframe_category  comment
   loop_
        _comment
        _every_flag
        _category

'#It has very upfield-shifted H5', H5" @ 3.935,4.012 ppm'
;
#######################
#  BOGUS              #
#######################

;

    BOGUS_CATEGORY

     stop_
save_
"""
        self.assertFalse(self.strf.parse(text = text))
        st = self.strf.star_text()
#            print "unparsed text:[" +st+ "]"

        exp = """data_no_comments_here
save_comment   _Saveframe_category  comment   loop_
        _comment
        _every_flag
        _category
;
#It has very upfield-shifted H5', H5" @ 3.935,4.012 ppm
;
;
#######################
#  BOGUS              #
#######################

;    BOGUS_CATEGORY     stop_ save_
"""
        self.assertTrue(Utils.equalIgnoringWhiteSpace(exp, st))