コード例 #1
0
ファイル: test_QueryNoNet.py プロジェクト: augustfly/pyvo
    def test_para_format(self):
        inp = """This tests the paragraph formatting functionality that 
                 will be used to disply resource descriptions.  This is not 
                 meant for display purpoes only.

                 It must be able to handle to handle multiple paragrasphs.  
                 The normal delimiter is a pair of consecutive new-line 
                 charactere, but other markup will be recognized as well,
                 e.g. "&lt;p&gt;".  <p> Formatting must be succeesful for 
                 $n$ paragraphs where $n > 1$.  It should even work on $n^2$ 
                 paragraphs."""

        out = """This tests the paragraph formatting
functionality that will be used to
disply resource descriptions.  This is
not meant for display purpoes only.

It must be able to handle to handle
multiple paragrasphs. The normal
delimiter is a pair of consecutive new-
line charactere, but other markup will
be recognized as well, e.g. "<p>".

Formatting must be succeesful for n
paragraphs where n > 1.  It should even
work on n^2 paragraphs."""

        text = dalq.para_format_desc(inp, 40)
        if text != out:
            for i in range(len(text)):
                if text[i] != out[i]:
                    print("format different from expected starting with: "+
                          text[i:])
                    break
        self.assertEquals(text, out, "Incorrect formatting.")
コード例 #2
0
    def test_para_format(self):
        inp = """This tests the paragraph formatting functionality that 
                 will be used to disply resource descriptions.  This is not 
                 meant for display purpoes only.

                 It must be able to handle to handle multiple paragrasphs.  
                 The normal delimiter is a pair of consecutive new-line 
                 charactere, but other markup will be recognized as well,
                 e.g. "&lt;p&gt;".  <p> Formatting must be succeesful for 
                 $n$ paragraphs where $n > 1$.  It should even work on $n^2$ 
                 paragraphs."""

        out = """This tests the paragraph formatting
functionality that will be used to
disply resource descriptions.  This is
not meant for display purpoes only.

It must be able to handle to handle
multiple paragrasphs. The normal
delimiter is a pair of consecutive new-
line charactere, but other markup will
be recognized as well, e.g. "<p>".

Formatting must be succeesful for n
paragraphs where n > 1.  It should even
work on n^2 paragraphs."""

        text = dalq.para_format_desc(inp, 40)
        if text != out:
            for i in range(len(text)):
                if text[i] != out[i]:
                    print("format different from expected starting with: " +
                          text[i:])
                    break
        self.assertEquals(text, out, "Incorrect formatting.")
コード例 #3
0
ファイル: test_QueryNoNet.py プロジェクト: augustfly/pyvo
    def test_fill(self):
        inp = """
The quick brown 
fox jumped over 
the lazy dogs.
"""
        out = """The quick brown fox jumped over the
lazy dogs."""

        self.assertEquals(dalq.para_format_desc(inp, 38), out)
コード例 #4
0
    def test_fill(self):
        inp = """
The quick brown 
fox jumped over 
the lazy dogs.
"""
        out = """The quick brown fox jumped over the
lazy dogs."""

        self.assertEquals(dalq.para_format_desc(inp, 38), out)
コード例 #5
0
ファイル: test_QueryNoNet.py プロジェクト: augustfly/pyvo
 def test_para_detect(self):
     for t in self.splittests:
         self.assertEquals(dalq.para_format_desc(t), "one\n\ntwo")
コード例 #6
0
 def test_para_detect(self):
     for t in self.splittests:
         self.assertEquals(dalq.para_format_desc(t), "one\n\ntwo")