~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to twisted/test/test_release.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-01-16 19:56:10 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060116195610-ykmxbia4mnnod9o2
Tags: 2.1.0-0ubuntu2
debian/copyright: Include copyright for python 2.3; some 2.3 files
are included in the upstream tarball, but not in the binary packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import os
2
 
from twisted.trial import unittest, assertions as A
 
2
from twisted.trial import unittest
3
3
 
4
4
from twisted.internet import reactor
5
5
from twisted.python import release, log
12
12
            os.mkdir('releaseCh')
13
13
            os.chdir('releaseCh')
14
14
            1/0
15
 
        A.assertRaises(ZeroDivisionError,
16
 
                       release.runChdirSafe, chAndBreak)
17
 
        A.assertEquals(cwd, os.getcwd())
 
15
        self.assertRaises(ZeroDivisionError,
 
16
                          release.runChdirSafe, chAndBreak)
 
17
        self.assertEquals(cwd, os.getcwd())
18
18
 
19
19
    def testReplaceInFile(self):
20
20
        in_ = 'foo\nhey hey $VER\nbar\n'
24
24
 
25
25
        expected = in_.replace('$VER', '2.0.0')
26
26
        release.replaceInFile('release.replace', {'$VER': '2.0.0'})
27
 
        A.assertEquals(open('release.replace').read(), expected)
 
27
        self.assertEquals(open('release.replace').read(), expected)
28
28
 
29
29
 
30
30
        expected = expected.replace('2.0.0', '3.0.0')
31
31
        release.replaceInFile('release.replace', {'2.0.0': '3.0.0'})
32
 
        A.assertEquals(open('release.replace').read(), expected)
 
32
        self.assertEquals(open('release.replace').read(), expected)
33
33