~oubiwann/pyrtf/master

« back to all changes in this revision

Viewing changes to test/document/test_characters.py

  • Committer: Christian R. Simms
  • Date: 2009-11-02 15:20:18 UTC
  • mfrom: (70.1.23)
  • Revision ID: git-v1:5d312e1d38efd162c6023edef6a6f453793df735
* split out object.picture from Elements so that increased coverage in test_pictures passes
* write test of Document.Copy
* add test of Document.NewSection
* add .bzrignore file to ignore pending directory
* add script to test coverage of code base
* write test script which runs nosetest on all unit tests and doctests
* centralize basic initializeDoc in tests
* move comments about test strategy
* delete old temp test code
* comment out unused code
* remove executable bit from tests so that nosetest can detect them

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
from rtfng.document.section import Section
8
8
from rtfng.document.paragraph import Paragraph
9
9
 
10
 
def initializeDoc():
11
 
    doc = Document()
12
 
    section = Section()
13
 
    doc.Sections.append(section)
14
 
    return (doc, section, doc.StyleSheet)
15
 
 
16
10
class CharacterTestCase(RTFTestCase):
17
11
 
18
12
    def make_charStyleOverride():
19
 
        doc, section, styles = initializeDoc()
 
13
        doc, section, styles = RTFTestCase.initializeDoc()
20
14
        p = Paragraph()
21
15
        p.append('This is a standard paragraph with the default style.')
22
16
        p = Paragraph()
34
28
        self.doTest()
35
29
 
36
30
    def make_charColours():
37
 
        doc, section, styles = initializeDoc()
 
31
        doc, section, styles = RTFTestCase.initializeDoc()
38
32
        section.append('This example test changing the colour of fonts.')
39
33
        # Text properties can be specified in two ways, either a text object
40
34
        # can have its text properties specified via the TextPropertySet
62
56
        self.doTest()
63
57
 
64
58
    def make_charUnicode():
65
 
        doc, section, styles = initializeDoc()
 
59
        doc, section, styles = RTFTestCase.initializeDoc()
66
60
        section.append('This tests unicode.')
67
61
        
68
62
        p = Paragraph()