def test_write(self): message = 'some message' self.assertFalse(os.path.exists(test_path)) Logger.write(message) self.assertTrue(os.path.exists(test_path)) with open(Logger.get_path(), 'r') as f: self.assertGreater(f.read().find(message), 0) os.remove(Logger.get_path()) self.assertFalse(os.path.exists(test_path))
def test_log(self): Logger.log('Some content', Logger.MESSAGE_ERROR_TYPE) self.assertGreater(os.path.getsize(test_path), 0) os.remove(test_path) self.assertFalse(os.path.exists(test_path))
def test_get_path(self): self.assertEqual(Logger.get_path(), test_path)
def test_log(self): Logger.log('Some content', True) self.assertGreater(os.path.getsize(test_path), 0) os.remove(test_path) self.assertFalse(os.path.exists(test_path))
def test_log(self): Logger.log("Some content", True) self.assertGreater(os.path.getsize(test_path), 0) os.remove(test_path) self.assertFalse(os.path.exists(test_path))