Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_featurecollection_stdin(expected_features):
sys.stdin = open("tests/twopoints.geojson", 'r')
features = normalize_feature_inputs(None, 'features', [])
assert _geoms(features) == _geoms(expected_features)
def test_featuresequence(expected_features):
features = normalize_feature_inputs(
None, 'features', ["tests/twopoints_seq.txt"])
assert _geoms(features) == _geoms(expected_features)
def test_featurecollection_pretty_file(expected_features):
features = normalize_feature_inputs(
None, 'features', ["tests/twopoints-pretty.json"])
assert _geoms(features) == _geoms(expected_features)
def test_featurecollection_file(expected_features):
features = normalize_feature_inputs(
None, 'features', ["tests/twopoints.geojson"])
assert _geoms(features) == _geoms(expected_features)
def test_singlefeature(expected_features):
features = normalize_feature_inputs(
None, 'features', ["tests/onepoint.geojson"])
assert _geoms(features) == _geoms([expected_features[0]])
def test_featuresequencers_stdin(expected_features):
sys.stdin = open("tests/twopoints_seqrs.txt", 'r')
features = normalize_feature_inputs(None, 'features', [])
assert _geoms(features) == _geoms(expected_features)
def test_featuresequencers(expected_features):
features = normalize_feature_inputs(
None, 'features', ["tests/twopoints_seqrs.txt"])
assert _geoms(features) == _geoms(expected_features)
def test_featuresequence_stdin(expected_features):
sys.stdin = open("tests/twopoints_seq.txt", 'r')
features = normalize_feature_inputs(None, 'features', [])
assert _geoms(features) == _geoms(expected_features)
def test_coordpairs_space(expected_features):
inputs = ["-122.7282 45.5801", "-121.3153 44.0582"]
features = normalize_feature_inputs(None, 'features', inputs)
assert _geoms(features) == _geoms(expected_features)
# Multiple files, last of which is an output file.
files_inout_arg = click.argument(
'files',
nargs=-1,
type=click.Path(resolve_path=True),
required=True,
metavar="INPUTS... OUTPUT")
# Features from files, command line args, or stdin.
# Returns the input data as an iterable of GeoJSON Feature-like
# dictionaries.
features_in_arg = click.argument(
'features',
nargs=-1,
callback=normalize_feature_inputs,
metavar="FEATURES...")
# Options.
verbose_opt = click.option(
'--verbose', '-v',
count=True,
help="Increase verbosity.")
quiet_opt = click.option(
'--quiet', '-q',
count=True,
help="Decrease verbosity.")
# Format driver option.
format_opt = click.option(