mirror of
https://github.com/JackHopkins/factorio-learning-environment.git
synced 2025-09-06 13:23:58 +00:00
updated api usage
This commit is contained in:
@@ -277,14 +277,14 @@ def test_harvest_provides_score(game):
|
||||
stone_position = game.nearest(Resource.Stone)
|
||||
game.move_to(stone_position)
|
||||
|
||||
stats = game._production_stats() # noqa
|
||||
stats = game._get_production_stats() # noqa
|
||||
reward, _ = game.score()
|
||||
# Mine 5 stone (enough for one furnace)
|
||||
stone_needed = 5
|
||||
stone_mined = game.harvest_resource(stone_position, stone_needed)
|
||||
print(f"Mined {stone_mined} stone")
|
||||
|
||||
nstats = game._production_stats() # noqa
|
||||
nstats = game._get_production_stats() # noqa
|
||||
nreward, _ = game.score()
|
||||
|
||||
assert nreward > reward
|
||||
|
@@ -45,7 +45,7 @@ class TestProductionStats(unittest.TestCase):
|
||||
|
||||
def test_lua2python(self):
|
||||
result = _lua2python(
|
||||
"pcall(global.actions.production_stats, 1)",
|
||||
"pcall(global.actions.get_production_stats, 1)",
|
||||
'{ ["a"] = true,["b"] = {\n ["iron-ore"] = 10\n},}',
|
||||
)
|
||||
assert result
|
||||
|
Reference in New Issue
Block a user