Edgewall Software

Changeset 1218


Ignore:
Timestamp:
Jan 26, 2013, 5:42:20 PM (11 years ago)
Author:
hodgestar
Message:

Merge r1217 from trunk (fix text template tests that were failing on Windows).

Location:
branches/stable/0.7.x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/0.7.x

    • Property svn:mergeinfo changed
      /trunkmerged: 1217
  • branches/stable/0.7.x/genshi/template/tests/text.py

    r1088 r1218  
    9595
    9696    def test_include(self):
    97         file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'w')
    98         try:
    99             file1.write("Included\n")
     97        file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'wb')
     98        try:
     99            file1.write(u"Included\n".encode("utf-8"))
    100100        finally:
    101101            file1.close()
    102102
    103         file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'w')
    104         try:
    105             file2.write("""----- Included data below this line -----
     103        file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'wb')
     104        try:
     105            file2.write(u"""----- Included data below this line -----
    106106            #include tmpl1.txt
    107             ----- Included data above this line -----""")
     107            ----- Included data above this line -----""".encode("utf-8"))
    108108        finally:
    109109            file2.close()
     
    220220
    221221    def test_include(self):
    222         file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'w')
    223         try:
    224             file1.write("Included")
     222        file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'wb')
     223        try:
     224            file1.write(u"Included".encode("utf-8"))
    225225        finally:
    226226            file1.close()
    227227
    228         file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'w')
    229         try:
    230             file2.write("""----- Included data below this line -----
     228        file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'wb')
     229        try:
     230            file2.write(u"""----- Included data below this line -----
    231231{% include tmpl1.txt %}
    232 ----- Included data above this line -----""")
     232----- Included data above this line -----""".encode("utf-8"))
    233233        finally:
    234234            file2.close()
     
    242242
    243243    def test_include_expr(self):
    244          file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'w')
     244         file1 = open(os.path.join(self.dirname, 'tmpl1.txt'), 'wb')
    245245         try:
    246              file1.write("Included")
     246             file1.write(u"Included".encode("utf-8"))
    247247         finally:
    248248             file1.close()
    249249 
    250          file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'w')
     250         file2 = open(os.path.join(self.dirname, 'tmpl2.txt'), 'wb')
    251251         try:
    252              file2.write("""----- Included data below this line -----
     252             file2.write(u"""----- Included data below this line -----
    253253    {% include ${'%s.txt' % ('tmpl1',)} %}
    254     ----- Included data above this line -----""")
     254    ----- Included data above this line -----""".encode("utf-8"))
    255255         finally:
    256256             file2.close()
Note: See TracChangeset for help on using the changeset viewer.