How to use the beamngpy.beamngcommon.BNGValueError function in beamngpy

To help you get started, we’ve selected a few beamngpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BeamNG / BeamNGpy / tests / test_scenario.py View on Github external
def test_new_scenario(beamng):
    with beamng as bng:
        scenario = Scenario('smallgrid', 'test_scenario')
        vehicle = Vehicle('test_car', model='etk800')
        scenario.add_vehicle(vehicle, pos=(0, 0, 0), rot=(0, 0, 0))
        scenario.make(bng)
        bng.load_scenario(scenario)
        assert bng.get_scenario_name() == 'test_scenario'

    scenario.delete(beamng)

    with beamng as bng:
        with pytest.raises(BNGValueError):
            bng.load_scenario(scenario)