def test_default_log_level_unchanged(self): fpath = self.start_new_log_file() log_unity_message("DEBUG", "This is some INFORMATION") sleep(1) reset_logging() with open(fpath, 'r') as f: self.assertThat(f.read(), Not(Contains("This is some INFORMATION")))
def test_messages_arrive_in_file(self): fpath = self.start_new_log_file() log_unity_message("WARNING", "This is a warning of things to come") sleep(1) reset_logging() with open(fpath, 'r') as f: self.assertThat(f.read(), Contains("This is a warning of things to come"))
def test_can_change_log_level(self): fpath = self.start_new_log_file() set_log_severity("", "DEBUG") self.addCleanup(set_log_severity, "", "INFO") log_unity_message("DEBUG", "This is some more INFORMATION") sleep(1) reset_logging() with open(fpath, 'r') as f: self.assertThat(f.read(), Contains("This is some more INFORMATION"))