Esempio n. 1
0
 def test_process_with_output_dir_failure_to_mkdir(self):
     self.create('somechannel-20130316.log')
     self.create('out')
     options = optparse.Values(dict(searchbox=True, dircproxy=True,
                                    pattern='*.log', force=False,
                                    prefix='IRC logs for ',
                                    output_dir=self.filename('out'),
                                    style='xhtmltable', title='IRC logs'))
     with self.assertRaises(Error):
         process(self.tmpdir, options)
Esempio n. 2
0
 def test_process_copies_css_even_when_all_logs_up_to_date(self):
     self.create('somechannel-20130316.log', mtime=-10)
     self.create('somechannel-20130316.log.html')
     options = optparse.Values(dict(searchbox=True, dircproxy=True,
                                    pattern='*.log', force=False,
                                    prefix='IRC logs for ', output_dir=None,
                                    style='xhtmltable', title='IRC logs'))
     process(self.tmpdir, options)
     self.assertTrue(os.path.exists(self.filename('index.html')))
     if hasattr(os, 'symlink'):
         self.assertTrue(os.path.exists(self.filename('latest.log.html')))
     self.assertTrue(os.path.exists(self.filename('irclog.css')))
Esempio n. 3
0
 def test_process_copies_css_even_when_all_logs_up_to_date(self):
     self.create('somechannel-20130316.log', mtime=-10)
     self.create('somechannel-20130316.log.html')
     options = optparse.Values(dict(searchbox=True, dircproxy=True,
                                    pattern='*.log', force=False,
                                    prefix='IRC logs for ',
                                    style='xhtmltable', title='IRC logs'))
     process(self.tmpdir, options)
     self.assertTrue(os.path.exists(self.filename('index.html')))
     if hasattr(os, 'symlink'):
         self.assertTrue(os.path.exists(self.filename('latest.log.html')))
     self.assertTrue(os.path.exists(self.filename('irclog.css')))
Esempio n. 4
0
 def test_process_with_output_dir(self):
     self.create('somechannel-20130316.log')
     options = optparse.Values(dict(searchbox=True, dircproxy=True,
                                    pattern='*.log', force=False,
                                    prefix='IRC logs for ',
                                    output_dir=self.filename('new/out/dir'),
                                    style='xhtmltable', title='IRC logs'))
     process(self.tmpdir, options)
     self.assertTrue(os.path.exists(self.filename('new/out/dir/index.html')))
     self.assertTrue(os.path.exists(self.filename('new/out/dir/irclog.css')))
     self.assertTrue(os.path.exists(
         self.filename('new/out/dir/somechannel-20130316.log.html')))
     if hasattr(os, 'symlink'):
         self.assertTrue(os.path.exists(
             self.filename('new/out/dir/latest.log.html')))