~mterry/duplicity/retry-decorator

« back to all changes in this revision

Viewing changes to testing/logtest.py

  • Committer: Kenneth Loafman
  • Date: 2011-03-08 19:45:47 UTC
  • Revision ID: kenneth@loafman.com-20110308194547-2xlgn8eesrphalyn
Various fixes for testing.  All tests pass completely.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
class LogTest(unittest.TestCase):
25
25
    """Test machine-readable functions/classes in log.py"""
26
 
    
 
26
 
27
27
    duplicity_bin = "../duplicity-bin"
28
28
 
 
29
    def setUp(self):
 
30
        assert not os.system("rm -f /tmp/duplicity.log")
 
31
 
 
32
    def tearDown(self):
 
33
        assert not os.system("rm -f /tmp/duplicity.log")
 
34
 
29
35
    def test_command_line_error(self):
30
36
        """Check notification of a simple error code"""
31
 
        
 
37
 
32
38
        # Run actual duplicity command (will fail, because no arguments passed)
33
39
        os.system("%s --log-file=/tmp/duplicity.log >/dev/null 2>&1" % self.duplicity_bin)
34
 
        
 
40
 
35
41
        # The format of the file should be:
36
42
        # """ERROR 2
37
43
        # . Blah blah blah.
38
44
        # . Blah blah blah.
39
 
        # 
 
45
        #
40
46
        # """
41
47
        f = open('/tmp/duplicity.log', 'r')
42
48
        linecount = 0