Skip to content

Commit

Permalink
tests: improving tests
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Nov 28, 2024
1 parent fbe92ac commit 244d4cc
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,20 @@ def test__get_parameter_array(mapdl, cleared, number):
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))

# High number
with pytest.raises(MapdlRuntimeError):
shape = (100, 100)
array = np.ones(shape) * number
mapdl.load_array(name=name, array=array)
mapdl.parameters._get_parameter_array(name, shape)
shape = (100, 100)
array = np.ones(shape) * number
mapdl.load_array(name=name, array=array)
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))

# Random number
array = np.random.rand(*shape)
mapdl.load_array(name=name, array=array)
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))

# Random big number
array = np.random.rand(*shape) * number
mapdl.load_array(name=name, array=array)
assert np.allclose(array, mapdl.parameters._get_parameter_array(name, shape))


def parameters_name(mapdl, func, par_name):
Expand Down

0 comments on commit 244d4cc

Please sign in to comment.