~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_corners.py

  • Committer: Matt Nordhoff
  • Date: 2010-02-26 04:37:13 UTC
  • mfrom: (400 trunk)
  • mto: This revision was merged to the branch mainline in revision 401.
  • Revision ID: mnordhoff@mattnordhoff.com-20100226043713-7mw3r6dr9qowutmi
Merge trunk for NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
        The commit adds a file called 'myfilename' containing the string
13
13
        'foo'.
14
14
        """
15
 
        f = open(os.path.join(self.bzrbranch, filename), 'w')
16
 
        try:
17
 
            f.write("foo")
18
 
        finally:
19
 
            f.close()
 
15
        self.build_tree_contents([(filename, 'foo')])
20
16
        self.tree.add(filename)
21
17
        self.tree.commit(message=commit_msg)
22
18
 
30
26
        self.addFileAndCommit('myfilename', msg)
31
27
 
32
28
        # Make a commit that changes the execute bit of 'myfilename'.
33
 
        os.chmod(os.path.join(self.bzrbranch, 'myfilename'), 0755)
 
29
        os.chmod('myfilename', 0755)
34
30
        newrevid = self.tree.commit(message='make something executable')
35
31
 
36
32
        # Check that it didn't break things.
38
34
        res = app.get('/revision/'+newrevid)
39
35
        res.mustcontain('executable')
40
36
 
 
37
    def test_revision_escapes_commit_message(self):
 
38
        """XXX."""
 
39
        self.createBranch()
 
40
 
 
41
        msg = '<b>hi</b>'
 
42
        self.addFileAndCommit('myfilename', msg)
 
43
        app = self.setUpLoggerhead()
 
44
        res = app.get('/revision/1')
 
45
        self.assertFalse(msg in res.body)
 
46
 
41
47
    def test_empty_commit_message(self):
42
48
        """Check that an empty commit message does not break the rendering."""
43
49
        self.createBranch()
50
56
        res = app.get('/changes')
51
57
        # It's not much of an assertion, but we only really care about
52
58
        # "assert not crashed".
53
 
        res.mustcontain('myfilename')
 
59
        res.mustcontain('1')
54
60
 
55
61
    def test_whitespace_only_commit_message(self):
56
62
        """Check that a whitespace-only commit message does not break the
65
71
        res = app.get('/changes')
66
72
        # It's not much of an assertion, but we only really care about
67
73
        # "assert not crashed".
68
 
        res.mustcontain('myfilename')
 
74
        res.mustcontain('1')