Ejemplo n.º 1
0
    def test_match_filter_neighborhood(self):
        possibilities = [
            {
                "id": 0,
                "tags": {
                    "name": "Tanjong Pagar Plaza"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": "Tanjong Pagar Food Centre"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": "Tanjong Pagar Plaza"
                }
            },
            {
                "id": 1,
                "tags": {
                    "name": "Tanjong Pagar"
                }
            },
        ]
        venue_name = "Tanjong Pagar"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(4, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 2
0
    def test_match_filter_visulite(self):
        possibilities = [
            {
                "id": 0,
                "tags": {
                    "name": "Taste of India"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": "Staunton"
                }
            },
            {
                "id": 1,
                "tags": {
                    "name": "Visulite Cinema"
                }
            },
        ]
        venue_name = "Visulite Cinema - Downtown Staunton"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(1, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 3
0
    def test_match_filter_apartment(self):
        possibilities = [
            {
                "id": 0,
                "tags": {
                    "name": "Berean Baptist Church"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": "Church of Christ of Albina"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": "Community Church of God"
                }
            },
            {
                "id": 1,
                "tags": {
                    "name": "The Mason Williams"
                }
            },
        ]
        venue_name = "The Mason Williams"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(1, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 4
0
    def test_match_filter_restaurant_no_match(self):
        possibilities = [
            {
                "id": 0,
                "tags": {
                    "name": u"IJssalon"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": u"Pathé Schouwburgplein"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": u"Plaza"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": u"Indonesia Satebar"
                }
            },
        ]
        venue_name = u"Has Döner Kebab"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(0, len(matches))
Ejemplo n.º 5
0
    def test_match_filter_iad_airport(self):
        possibilities = [
            {
                "id": 0,
                "tags": {
                    "name": "Dunkin' Donuts"
                }
            },
            {
                "id": 1,
                "tags": {
                    "name": "Ronald Reagan Washington National Airport"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": "Police"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": "Faber News"
                }
            },
        ]
        venue_name = "Ronald Reagan Washington National Airport (DCA)"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(1, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 6
0
    def test_match_filter_waffle_shop(self):
        possibilities = [
            {"id": 0, "tags": {"name": u"Tariff Commission Building"}},
            {"id": 0, "tags": {"name": u"Foo Bar"}},
        ]
        venue_name = u"Lincoln's Waffle Shop"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(0, len(matches))
Ejemplo n.º 7
0
    def test_match_filter_restaurant_no_match(self):
        possibilities = [
            {"id": 0, "tags": {"name": u"IJssalon"}},
            {"id": 0, "tags": {"name": u"Pathé Schouwburgplein"}},
            {"id": 0, "tags": {"name": u"Plaza"}},
            {"id": 0, "tags": {"name": u"Indonesia Satebar"}},
        ]
        venue_name = u"Has Döner Kebab"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(0, len(matches))
Ejemplo n.º 8
0
    def test_match_filter_visulite(self):
        possibilities = [
            {"id": 0, "tags": {"name": "Taste of India"}},
            {"id": 0, "tags": {"name": "Staunton"}},
            {"id": 1, "tags": {"name": "Visulite Cinema"}},
        ]
        venue_name = "Visulite Cinema - Downtown Staunton"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(1, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 9
0
    def test_match_filter_neighborhood(self):
        possibilities = [
            {"id": 0, "tags": {"name": "Tanjong Pagar Plaza"}},
            {"id": 0, "tags": {"name": "Tanjong Pagar Food Centre"}},
            {"id": 0, "tags": {"name": "Tanjong Pagar Plaza"}},
            {"id": 1, "tags": {"name": "Tanjong Pagar"}},
        ]
        venue_name = "Tanjong Pagar"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(4, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 10
0
    def test_match_filter_apartment(self):
        possibilities = [
            {"id": 0, "tags": {"name": "Berean Baptist Church"}},
            {"id": 0, "tags": {"name": "Church of Christ of Albina"}},
            {"id": 0, "tags": {"name": "Community Church of God"}},
            {"id": 1, "tags": {"name": "The Mason Williams"}},
        ]
        venue_name = "The Mason Williams"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(1, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 11
0
    def test_match_filter_iad_airport(self):
        possibilities = [
            {"id": 0, "tags": {"name": "Dunkin' Donuts"}},
            {"id": 1, "tags": {"name": "Ronald Reagan Washington National Airport"}},
            {"id": 0, "tags": {"name": "Police"}},
            {"id": 0, "tags": {"name": "Faber News"}},
        ]
        venue_name = "Ronald Reagan Washington National Airport (DCA)"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(1, len(matches))
        self.assertEqual(1, matches[0][1]['id'])
Ejemplo n.º 12
0
    def test_match_filter_waffle_shop(self):
        possibilities = [
            {
                "id": 0,
                "tags": {
                    "name": u"Tariff Commission Building"
                }
            },
            {
                "id": 0,
                "tags": {
                    "name": u"Foo Bar"
                }
            },
        ]
        venue_name = u"Lincoln's Waffle Shop"
        matches = filter_matches(venue_name, possibilities)

        self.assertEqual(0, len(matches))