def test_emit_empty(self): m = Mock() t = datetime.time() failure = Mock() failure.getTraceback.return_value = "" _emit(m, {"message": "", "time": t, "isError": "", "failure": failure}) self.assertEqual(m.formatTime.call_count, 0)
def test_emit(self): m = Mock() t = datetime.time() _emit(m, { "message": "some message", "time": t }) m.formatTime.assert_called_with(t)
def test_emit_empty(self): m = Mock() t = datetime.time() failure = Mock() failure.getTraceback.return_value = "" _emit(m, { "message": "", "time": t, "isError": "", "failure": failure }) self.assertEqual(m.formatTime.call_count, 0)