<commit_before>from landlab import RasterModelGrid, FieldError
from landlab.components import FlowAccumulator, FastscapeEroder, FlowDirectorSteepest
import numpy as np
from landlab.utils.stream_length import calculate_stream_length

from nose.tools import assert_equal, assert_true, assert_false, assert_raises

def test_no_flow_recievers():
    """Test that correct error is raised when no flow recievers are on the grid."""
    # instantiate a model grid, do not run flow accumulation on it
    mg = RasterModelGrid(30, 70)
    # test that the stream length utility will fail because of a ValueError
    assert_raises(FieldError, calculate_stream_length, mg)

def test_no_upstream_array():
    """Test that correct error is raised when no flow__upstream_node_order."""
    # instantiate a model grid, do not run flow accumulation on it
    mg = RasterModelGrid(30, 70)
    z = mg.add_zeros('topographic__elevation', at='node')
    fd = FlowDirectorSteepest(mg)
    fd.run_one_step()
    # test that the stream length utility will fail because of a ValueError
    assert_raises(FieldError, calculate_stream_length, mg)<commit_msg>add a missing statement<commit_after>from landlab import RasterModelGrid, FieldError
from landlab.components import FlowAccumulator, FastscapeEroder, FlowDirectorSteepest
import numpy as np
from landlab.utils.stream_length import calculate_stream_length

from nose.tools import assert_equal, assert_true, assert_false, assert_raises

def test_no_flow_recievers():
    """Test that correct error is raised when no flow recievers are on the grid."""
    # instantiate a model grid, do not run flow accumulation on it
    mg = RasterModelGrid(30, 70)
    # test that the stream length utility will fail because of a ValueError
    assert_raises(FieldError, calculate_stream_length, mg)

def test_no_upstream_array():
    """Test that correct error is raised when no flow__upstream_node_order."""
    # instantiate a model grid, do not run flow accumulation on it
    mg = RasterModelGrid(30, 70)

    fd = FlowDirectorSteepest(mg)
    fd.run_one_step()
    # test that the stream length utility will fail because of a ValueError
    assert_raises(FieldError, calculate_stream_length, mg)
{'fraction_non_alphanumeric': 0.059593679458239276, 'fraction_numerical': 0.007223476297968397, 'mean_word_length': 4.989189189189189, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1071392', 'n_tokens_mistral': 645, 'n_tokens_neox': 621, 'n_words': 233}