def test_config(self):
     config = mock.Mock()
     config.config = {'cloud': 'cloudy'}
     config.auth = {'project_name': 'projecty', 'username': '******'}
     formatter = context._FileFormatter(config=config)
     self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
                       '%(name)s [cloudy usernamey projecty] %(message)s'),
                      formatter.fmt)
 def test_config(self):
     config = mock.Mock()
     config.config = {'cloud': 'cloudy'}
     config.auth = {'project_name': 'projecty', 'username': '******'}
     formatter = context._FileFormatter(config=config)
     self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
                       '%(name)s [cloudy usernamey projecty] %(message)s'),
                      formatter.fmt)
 def test_options(self):
     class Opts(object):
         cloud = 'cloudy'
         os_project_name = 'projecty'
         username = '******'
     options = Opts()
     formatter = context._FileFormatter(options=options)
     self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
                       '%(name)s [cloudy usernamey projecty] %(message)s'),
                      formatter.fmt)
    def test_options(self):
        class Opts(object):
            cloud = 'cloudy'
            os_project_name = 'projecty'
            username = '******'

        options = Opts()
        formatter = context._FileFormatter(options=options)
        self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
                          '%(name)s [cloudy usernamey projecty] %(message)s'),
                         formatter.fmt)
 def test_nothing(self):
     formatter = context._FileFormatter()
     self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
                       '%(name)s %(message)s'), formatter.fmt)
 def test_nothing(self):
     formatter = context._FileFormatter()
     self.assertEqual(('%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
                       '%(name)s %(message)s'), formatter.fmt)