~james-w/udd/management-commands

« back to all changes in this revision

Viewing changes to udd/tests/test_logrotate.py

  • Committer: James Westby
  • Date: 2011-12-13 21:09:15 UTC
  • mfrom: (555.1.1 drop-cricket)
  • mto: This revision was merged to the branch mainline in revision 560.
  • Revision ID: james.westby@canonical.com-20111213210915-mfx5hktfoivb94hk
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from udd import tests
 
2
 
 
3
from udd.scripts import logrotate
 
4
 
 
5
 
 
6
class TestLogrotate(tests.TestCaseWithConfig):
 
7
 
 
8
    def test_empty(self):
 
9
        logrotate.main()
 
10
        log_conf_path = 'logs/driver/logrotate.conf'
 
11
        self.assertTestPathExists(log_conf_path)
 
12
        with open(log_conf_path) as f:
 
13
            # Checking that the right path have been expanded by relying just
 
14
            # on the dir used.
 
15
            self.assertContainsRe(f.read(), self.test_dir)