Skip to content

Commit

Permalink
fixing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkchafin committed May 7, 2024
1 parent f832a58 commit f9ef9c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/resistnet/test_resistance_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_evaluate_null_model(resistance_network_fixture):


@pytest.mark.parametrize("individual, expected_fitness", [
([1, 1, 1, 1], -100)
([1, 1, 1, 1, 0], -100)
])
def test_evaluate(resistance_network_fixture, individual, expected_fitness):
mock_parse_result = pd.DataFrame({
Expand All @@ -163,15 +163,15 @@ def test_evaluate(resistance_network_fixture, individual, expected_fitness):
fitness, res = resistance_network_fixture.evaluate(individual)

# Check that parsePairwise was called if variables are selected
if any(individual[0::4]):
if any(individual[0::5]):
mock_parsePairwise.assert_called()

assert fitness == expected_fitness


def test_model_output_mock(resistance_network_fixture):
# Mock model representing an individual in the genetic algorithm
model = [1, 1, 1, 1]
model = [1, 1, 1, 1, 1]

# Mock effective resistance matrix
mock_effective_resistance_matrix = np.array([[0.5, 1.0], [1.0, 0.5]])
Expand All @@ -188,7 +188,7 @@ def test_model_output_mock(resistance_network_fixture):

def test_model_output(resistance_network_fixture):
# Mock model representing an individual in the genetic algorithm
model = [1, 1, 1, 1]
model = [1, 1, 1, 1, 1]

try:
r, multi = resistance_network_fixture.model_output(model)
Expand Down

0 comments on commit f9ef9c5

Please sign in to comment.