~sandy-walsh/nova/zones

« back to all changes in this revision

Viewing changes to nova/tests/test_log.py

  • Committer: Sandy Walsh
  • Date: 2011-02-17 21:39:03 UTC
  • mfrom: (635.1.60 nova)
  • Revision ID: sandy.walsh@rackspace.com-20110217213903-swehe88wea8inxow
changed from 003-004 migration

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
        self.assert_(True)  # didn't raise exception
47
47
 
48
48
 
 
49
class LogHandlerTestCase(test.TestCase):
 
50
    def test_log_path_logdir(self):
 
51
        self.flags(logdir='/some/path')
 
52
        self.assertEquals(log.get_log_file_path(binary='foo-bar'),
 
53
                         '/some/path/foo-bar.log')
 
54
 
 
55
    def test_log_path_logfile(self):
 
56
        self.flags(logfile='/some/path/foo-bar.log')
 
57
        self.assertEquals(log.get_log_file_path(binary='foo-bar'),
 
58
                         '/some/path/foo-bar.log')
 
59
 
 
60
    def test_log_path_none(self):
 
61
        self.assertTrue(log.get_log_file_path(binary='foo-bar') is None)
 
62
 
 
63
    def test_log_path_logfile_overrides_logdir(self):
 
64
        self.flags(logdir='/some/other/path',
 
65
                   logfile='/some/path/foo-bar.log')
 
66
        self.assertEquals(log.get_log_file_path(binary='foo-bar'),
 
67
                         '/some/path/foo-bar.log')
 
68
 
 
69
 
49
70
class NovaFormatterTestCase(test.TestCase):
50
71
    def setUp(self):
51
72
        super(NovaFormatterTestCase, self).setUp()