def test_reset(self, init_stats, mocker): stats = init_stats() stats._last_run_time = mocker.MagicMock(spec=float) stats._run_count = mocker.MagicMock(spec=int) stats._total_time = mocker.MagicMock(spec=float) stats.reset() assert stats._last_run_time == 0 assert stats._run_count == 0 assert stats._total_time == 0
def test_reset(self): stats = ht.events.stats.HoudiniEventStats(None) stats._last_run_time = MagicMock(spec=float) stats._run_count = MagicMock(spec=int) stats._total_time = MagicMock(spec=float) stats.reset() self.assertEqual(stats._last_run_time, 0) self.assertEqual(stats._run_count, 0) self.assertEqual(stats._total_time, 0)
def test_reset(self, init_item_stats, mocker): mock_super_reset = mocker.patch.object( ht.events.stats.HoudiniEventStats, "reset") mock_item_stats = mocker.patch.object( ht.events.stats.HoudiniEventItemStats, "item_stats", new_callable=mocker.PropertyMock) stats = init_item_stats() stats.reset() mock_super_reset.assert_called_once() mock_item_stats.return_value.clear.assert_called_once()
def test_reset(self, mock_super_reset, mock_item_stats): stats = ht.events.stats.HoudiniEventItemStats(None) stats.reset() mock_super_reset.assert_called_once() mock_item_stats.return_value.clear.assert_called_once()