MCPcopy Create free account
hub / github.com/ahalev/python-microgrid / test_current_step

Method test_current_step

tests/microgrid/test_microgrid.py:235–243  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

233 self.assertTrue(empty_action_space != has_corresponding_action) # XOR
234
235 def test_current_step(self):
236 microgrid = get_modular_microgrid()
237
238 self.assertEqual(microgrid.current_step, 0)
239
240 for j in range(4):
241 with self.subTest(step=j):
242 microgrid.step(microgrid.sample_action())
243 self.assertEqual(microgrid.current_step, j+1)
244
245 def test_current_step_after_reset(self):
246 microgrid = get_modular_microgrid()

Callers

nothing calls this directly

Calls 4

get_modular_microgridFunction · 0.90
assertEqualMethod · 0.80
stepMethod · 0.45
sample_actionMethod · 0.45

Tested by

no test coverage detected