<commit_before># -*- encoding: utf-8 -*-
from . import FixtureTest


class ParkingTest(FixtureTest):

    def test_parking_node(self):
        import dsl

        z, x, y = (16, 10477, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/1706619902
            dsl.point(1706619902, (-122.445233, 37.776196), {
                'amenity': 'parking',
                'name': 'Fulton Market Garage',
                'parking': 'underground',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 1706619902,
                'kind': 'parking_garage',
                'min_zoom': 18,
                'capacity': type(None),  # should _not_ set capacity
            })

    def test_parking_tiny(self):
        import dsl

        z, x, y = (16, 10466, 25340)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/257593333
            dsl.way(257593333, dsl.box_area(z, x, y, 678), {
                'amenity': 'parking',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 257593333,
                'kind': 'parking',
                'min_zoom': 17,
                'capacity': int,
            })

    def test_parking_small(self):
        import dsl

        z, x, y = (16, 10471, 25341)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/506510951
            dsl.way(506510951, dsl.box_area(z, x, y, 2207), {
                'amenity': 'parking',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 506510951,
                'kind': 'parking',
                'min_zoom': 17,
                'capacity': int,
            })

    def test_parking_medium(self):
        import dsl

        z, x, y = (16, 10471, 25341)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/162093420
            dsl.way(162093420, dsl.box_area(z, x, y, 6111), {
                'access': 'destination',
                'amenity': 'parking',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 162093420,
                'kind': 'parking',
                'min_zoom': 17,
                'capacity': int,
            })

    def test_parking_huge_1(self):
        import dsl

        z, x, y = (15, 5234, 12670)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/32928608
            dsl.way(32928608, dsl.box_area(z, x, y, 16489), {
                'amenity': 'parking',
                'source': 'openstreetmap.org',
                'tiger:cfcc': 'A41',
                'tiger:county': 'San Francisco, CA',
                'tiger:reviewed': 'no',
            }),<commit_msg>Update test for zoom pharfing (back to orig)<commit_after># -*- encoding: utf-8 -*-
from . import FixtureTest


class ParkingTest(FixtureTest):

    def test_parking_node(self):
        import dsl

        z, x, y = (16, 10477, 25330)

        self.generate_fixtures(
            # https://www.openstreetmap.org/node/1706619902
            dsl.point(1706619902, (-122.445233, 37.776196), {
                'amenity': 'parking',
                'name': '<NAME>',
                'parking': 'underground',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 1706619902,
                'kind': 'parking_garage',
                'min_zoom': 18,
                'capacity': type(None),  # should _not_ set capacity
            })

    def test_parking_tiny(self):
        import dsl

        z, x, y = (16, 10466, 25340)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/257593333
            dsl.way(257593333, dsl.box_area(z, x, y, 678), {
                'amenity': 'parking',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 257593333,
                'kind': 'parking',
                'min_zoom': 17,
                'capacity': int,
            })

    def test_parking_small(self):
        import dsl

        z, x, y = (16, 10471, 25341)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/506510951
            dsl.way(506510951, dsl.box_area(z, x, y, 2207), {
                'amenity': 'parking',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 506510951,
                'kind': 'parking',
                'min_zoom': 17,
                'capacity': int,
            })

    def test_parking_medium(self):
        import dsl

        z, x, y = (16, 10471, 25341)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/162093420
            dsl.way(162093420, dsl.box_area(z, x, y, 6111), {
                'access': 'destination',
                'amenity': 'parking',
                'source': 'openstreetmap.org',
            }),
        )

        self.assert_has_feature(
            z, x, y, 'pois', {
                'id': 162093420,
                'kind': 'parking',
                'min_zoom': 16,
                'capacity': int,
            })

    def test_parking_huge_1(self):
        import dsl

        z, x, y = (15, 5234, 12670)

        self.generate_fixtures(
            # https://www.openstreetmap.org/way/32928608
            dsl.way(32928608, dsl.box_area(z, x, y, 16489), {
                'amenity': 'parking',
                'source': 'openstreetmap.org',
                'tiger:cfcc': 'A41',
                'tiger:county': 'San Francisco, CA',
                'tiger:reviewed': 'no',
            }),
{'fraction_non_alphanumeric': 0.13655013950434924, 'fraction_numerical': 0.0758247168882324, 'mean_word_length': 1.349267540478026, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 10, 'lorem ipsum': 0, 'www.': 10, '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': '3691449', 'n_tokens_mistral': 2340, 'n_tokens_neox': 1892, 'n_words': 371}