Exemplo n.º 1
0
 def test_stop_agents_raise_ValueError(self, fixture_stop_agents,
                                       fixture_raise_errors):
     """
     Raises an exception when the input DataFrame columns `vx` or `vy`
     does not exist.
     """
     df = DataFrame(pytest.data_wrong_name_columns)
     with pytest.raises(ValueError):
         AgentMovement.stop_agents(df, pytest.list_index_stopped)
Exemplo n.º 2
0
    def test_stop_agents(self, fixture_stop_agents):
        """Stops agent movement with a correct list of index."""
        df = DataFrame(pytest.data)
        df = AgentMovement.stop_agents(df, pytest.list_index_stopped)

        for i in range(len(pytest.list_index_stopped)):
            assert df['vx'][i] == df['vy'][i] == 0