cfc23b0091d55b53eef9654fe0e9134ac12b8c38,tests/components/test_history.py,TestComponentHistory,test_get_states,#TestComponentHistory#,66
Before Change
if i < 5:
states.append(state)
if i == 4:
time.sleep(1)
point = dt_util.utcnow()
self.assertEqual(
states,
sorted(
history.get_states(point), key=lambda state: state.entity_id))
After Change
with patch("homeassistant.util.dt.utcnow", return_value=point):
for i in range(5):
state = ha.State(
"test.point_in_time_{}".format(i % 5),
"State {}".format(i),
{"attribute_test": i})
mock_state_change_event(self.hass, state)
self.hass.pool.block_till_done()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: home-assistant/home-assistant
Commit Name: cfc23b0091d55b53eef9654fe0e9134ac12b8c38
Time: 2015-09-12
Author: paulus@paulusschoutsen.nl
File Name: tests/components/test_history.py
Class Name: TestComponentHistory
Method Name: test_get_states
Project Name: ShangtongZhang/reinforcement-learning-an-introduction
Commit Name: ff8cc9e75f5ddb1473efff36d3f33c092d98391a
Time: 2018-08-05
Author: zhangshangtong.cpp@icloud.com
File Name: chapter01/TicTacToe.py
Class Name: Judger
Method Name: play
Project Name: pgmpy/pgmpy
Commit Name: c7937882fce356c540e526f3eb690b304f83c9d7
Time: 2015-08-15
Author: pratyaksh@me.com
File Name: pgmpy/models/MarkovChain.py
Class Name: MarkovChain
Method Name: sample