def test_makeTAC_existing_incorrect(self): with open(os.path.join("test", "buildbot.tac"), "wt") as f: f.write("WRONG") create_master.makeTAC(mkconfig(basedir="test")) self.assertInTacFile("WRONG") self.assertTrue(os.path.exists(os.path.join("test", "buildbot.tac.new"))) self.assertInStdout("not touching existing buildbot.tac")
def test_makeTAC_existing_incorrect(self): with open(os.path.join('test', 'buildbot.tac'), 'wt') as f: f.write('WRONG') create_master.makeTAC(mkconfig(basedir='test')) self.assertInTacFile("WRONG") self.assertTrue(os.path.exists( os.path.join('test', 'buildbot.tac.new'))) self.assertInStdout('not touching existing buildbot.tac')
def test_makeTAC_none_log_count(self): create_master.makeTAC(mkconfig(basedir='test', **{'log-count': None})) self.assertInTacFile("\nmaxRotatedFiles = None\n") self.assertWasQuiet()
def test_makeTAC_int_log_size(self): create_master.makeTAC(mkconfig(basedir='test', **{'log-size': 3000})) self.assertInTacFile("\nrotateLength = 3000\n") self.assertWasQuiet()
def test_makeTAC_relocatable(self): create_master.makeTAC(mkconfig(basedir='test', relocatable=True)) self.assertInTacFile("basedir = '.'") # repr() prefers '' self.assertWasQuiet()
def test_makeTAC_no_logrotate(self): create_master.makeTAC( mkconfig(basedir='test', **{'no-logrotate': True})) self.assertNotInTacFile("import Log") self.assertWasQuiet()
def test_makeTAC_existing_correct(self): create_master.makeTAC(mkconfig(basedir='test', quiet=True)) create_master.makeTAC(mkconfig(basedir='test')) self.assertFalse(os.path.exists( os.path.join('test', 'buildbot.tac.new'))) self.assertInStdout('and is correct')
def test_makeTAC(self): create_master.makeTAC(mkconfig(basedir='test')) self.assertInTacFile("Application('buildmaster')") self.assertWasQuiet()
def test_makeTAC_existing_incorrect_quiet(self): with open(os.path.join('test', 'buildbot.tac'), 'wt') as f: f.write('WRONG') create_master.makeTAC(mkconfig(basedir='test', quiet=True)) self.assertInTacFile("WRONG") self.assertWasQuiet()
def test_makeTAC_str_log_size(self): with self.assertRaises(TypeError): create_master.makeTAC(mkconfig(basedir='test', **{'log-size': '3000'}))
def test_makeTAC_existing_incorrect_quiet(self): with open(os.path.join("test", "buildbot.tac"), "wt") as f: f.write("WRONG") create_master.makeTAC(mkconfig(basedir="test", quiet=True)) self.assertInTacFile("WRONG") self.assertWasQuiet()
def test_makeTAC_existing_correct(self): create_master.makeTAC(mkconfig(basedir="test", quiet=True)) create_master.makeTAC(mkconfig(basedir="test")) self.assertFalse(os.path.exists(os.path.join("test", "buildbot.tac.new"))) self.assertInStdout("and is correct")
def test_makeTAC_int_log_count(self): create_master.makeTAC(mkconfig(basedir="test", **{"log-count": 30})) self.assertInTacFile("\nmaxRotatedFiles = 30\n") self.assertWasQuiet()