コード例 #1
0
 def test_bare(self):
     """Bare section read/write"""
     my_title = Title()
     default_text = TitleWriter.as_text(my_title)
     test_text = "[TITLE]\n" + "SWMM Project"
     my_title = TitleReader.read(test_text)
     actual_text = TitleWriter.as_text(my_title)
     msg = '\nSet:'+test_text+'\nGet:'+actual_text
     self.assertTrue(match(actual_text, test_text), msg)
コード例 #2
0
 def test_empty_wo_return(self):
     """Empty section read/write wo ending carriage return"""
     test_text = "[TITLE]\n" + "SWMM Project"
     my_title = TitleReader.read(test_text)
     actual_text = TitleWriter.as_text(my_title)
     msg = '\nSet:'+test_text+'\nGet:'+actual_text
     self.assertTrue(match(actual_text, test_text), msg)
コード例 #3
0
 def test_empty(self):
     """Empty section read/write"""
     test_text = "[TITLE]\n"
     my_title = TitleReader.read(test_text)
     actual_text = TitleWriter.as_text(my_title)
     msg = '\nSet:' + test_text + '\nGet:' + actual_text
     self.assertTrue(match(actual_text, test_text), msg)
コード例 #4
0
 def test_one_row_wt_return(self):
     """One-row title wt ending carriage return"""
     test_text = "[TITLE]\n" \
                 "test_title\n"
     my_title = TitleReader.read(test_text)
     actual_text = TitleWriter.as_text(my_title)
     msg = '\nSet:'+test_text+'\nGet:'+actual_text
     self.assertTrue(match(actual_text, test_text), msg)
コード例 #5
0
 def test_return_before_title(self):
     """Carriage return before Section title"""
     test_text = "\n"\
                 "[TITLE]\n"\
                 "test_title"
     my_title = TitleReader.read(test_text)
     actual_text = TitleWriter.as_text(my_title)
     msg = '\nSet:'+test_text+'\nGet:'+actual_text
     self.assertTrue(match(actual_text, test_text), msg)
コード例 #6
0
    def test_multiple_lines(self):
        """Test multiple lines with empty lines"""
        test_text = r"""[TITLE]

                test_title

                """
        my_title = TitleReader.read(test_text)
        actual_text = TitleWriter.as_text(my_title)
        msg = '\nSet:'+test_text+'\nGet:'+actual_text
        self.assertTrue(match(actual_text, test_text), msg)