# Path: matcher/utils.py
# def chunk(it, size):
# def flatten(l):
# def drop_start(s, start):
# def remove_start(s, start):
# def normalize_url(url):
# def contains_digit(s):
# def cache_dir():
# def cache_filename(filename):
# def load_from_cache(filename):
# def get_radius(default=1000):
# def get_int_arg(name):
# def calc_chunk_size(area_in_sq_km, size=22):
# def file_missing_or_empty(filename):
# def is_bot():
# def log_location():
# def good_location():
# def capfirst(value):
# def any_upper(value):
# def find_log_file(place):
# def get_free_space(config):
# def display_distance(units, dist):
# def is_in_range(address_range, address):
# def pluralize_label(label):


from matcher import utils
import pytest
    assert utils.capfirst('TEST') == 'TEST'
    assert utils.capfirst('tEST') == 'TEST'
    assert utils.capfirst('test test') == 'Test test'

def test_flatten():
    sample = [[1, 2], [3, 4]]
    assert utils.flatten(sample) == [1, 2, 3, 4]

def test_drop_start():
    assert utils.drop_start('aaabbb', 'aaa') == 'bbb'

    with pytest.raises(AssertionError):
        assert utils.drop_start('aaabbb', 'ccc')

def test_remove_start():
    assert utils.remove_start('aaabbb', 'aaa') == 'bbb'
    assert utils.remove_start('aaabbb', 'ccc') == 'aaabbb'

def test_display_distance():
    units = 'km_and_metres'
    assert utils.display_distance(units, 10) == '10 m'
    assert utils.display_distance(units, 500) == '500 m'
    assert utils.display_distance(units, 1000) == '1.00 km'

    units = 'miles_and_feet'
    assert utils.display_distance(units, 500) == '1,640 feet'
    assert utils.display_distance(units, 1000) == '0.62 miles'
    assert utils.display_distance(units, 10_000) == '6.21 miles'

    units = 'miles_and_yards'

# Path: matcher/utils.py
# def chunk(it, size):
# def flatten(l):
# def drop_start(s, start):
# def remove_start(s, start):
# def normalize_url(url):
# def contains_digit(s):
# def cache_dir():
# def cache_filename(filename):
# def load_from_cache(filename):
# def get_radius(default=1000):
# def get_int_arg(name):
# def calc_chunk_size(area_in_sq_km, size=22):
# def file_missing_or_empty(filename):
# def is_bot():
# def log_location():
# def good_location():
# def capfirst(value):
# def any_upper(value):
# def find_log_file(place):
# def get_free_space(config):
# def display_distance(units, dist):
# def is_in_range(address_range, address):
# def pluralize_label(label):


# Path: tests/test_utils.py
from matcher import utils
import pytest

    assert utils.capfirst('TEST') == 'TEST'
    assert utils.capfirst('tEST') == 'TEST'
    assert utils.capfirst('test test') == 'Test test'

def test_flatten():
    sample = [[1, 2], [3, 4]]
    assert utils.flatten(sample) == [1, 2, 3, 4]

def test_drop_start():
    assert utils.drop_start('aaabbb', 'aaa') == 'bbb'

    with pytest.raises(AssertionError):
        assert utils.drop_start('aaabbb', 'ccc')

def test_remove_start():
    assert utils.remove_start('aaabbb', 'aaa') == 'bbb'
    assert utils.remove_start('aaabbb', 'ccc') == 'aaabbb'

def test_display_distance():
    units = 'km_and_metres'
    assert utils.display_distance(units, 10) == '10 m'
    assert utils.display_distance(units, 500) == '500 m'
    assert utils.display_distance(units, 1000) == '1.00 km'

    units = 'miles_and_feet'
    assert utils.display_distance(units, 500) == '1,640 feet'
    assert utils.display_distance(units, 1000) == '0.62 miles'
    assert utils.display_distance(units, 10_000) == '6.21 miles'

    units = 'miles_and_yards'

    assert utils.display_distance(units, 500) == '547 yards'