Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcpni committed Jun 27, 2019
1 parent af55fce commit 23e9d30
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/functions/test_combination.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_with_default_variable(self):

@pytest.mark.function
@pytest.mark.combination_function
def arrangement_has_out_of_bounds_index(self):
def test_arrangement_has_out_of_bounds_index(self):
with pytest.raises(pnl.FunctionError) as error_text:
pnl.Rearrange(default_variable=[0,0], arrangement=[(1,2),0])
error_msg = "'default_variable' for Rearrange must be at least 2d."
Expand All @@ -41,17 +41,19 @@ def test_default_variable_mismatches_arrangement(self):

@pytest.mark.function
@pytest.mark.combination_function
def default_variable_has_non_numeric_index(self):
with pytest.raises(pnl.FunctionError) as error_text:
def test_default_variable_has_non_numeric_index(self):
# with pytest.raises(pnl.FunctionError) as error_text:
with pytest.raises(pnl.UtilitiesError) as error_text:
pnl.Rearrange(default_variable=[[0],['a']], arrangement=[(1,2),0])
error_msg = "All elements of 'default_variable' for Rearrange must be scalar vlues."
# error_msg = "All elements of 'default_variable' for Rearrange must be scalar values."
error_msg = "[['0']\\n ['a']] has non-numeric entries"
assert error_msg in str(error_text)

@pytest.mark.function
@pytest.mark.combination_function
def arrangement_has_non_numeric_index(self):
def test_arrangement_has_non_numeric_index(self):
with pytest.raises(pnl.FunctionError) as error_text:
pnl.Rearrange(default_variable=[[0],[0]], arrangement=[(1,2),'a'])
pnl.Rearrange(default_variable=[[0],[0],[0]], arrangement=[(1,2),'a'])
error_msg_a = "Index specified in 'arrangement' arg"
error_msg_b = "('a') is not an int."
assert all(error_msg in str(error_text) for error_msg in {error_msg_a, error_msg_b})
Expand Down

0 comments on commit 23e9d30

Please sign in to comment.