# Path: tests/fixtures/base_test.py
# FIXTURE_PATH = pwd
# def ingest_point_fixture(fixture_meta, fname):
# def drop_tables(table_names):
#     def __init__(self, human_name, file_name):
#     def setUpClass(cls, shutdown=False):
#     def ingest_shapes(cls):
#     def ingest_points(cls):
#     def ingest_fixture(fixture):
#     def tearDownClass(cls):
# class ShapeFixture(object):
# class BasePlenarioTest(unittest.TestCase):


import json
import os
import urllib.request, urllib.parse, urllib.error
import csv
from io import StringIO
from tests.fixtures.base_test import BasePlenarioTest, fixtures_path
                          FLU_FILTER_SIMPLE + ', ' + \
                          FLU_FILTER_SIMPLE2 + ']}'
# Returns 13 rows.
FLU_FILTER_COMPOUND_OR = FLU_BASE + '{"op": "or", "val": [' + \
                          FLU_FILTER_SIMPLE + ', ' + \
                          FLU_FILTER_SIMPLE2 + ']}'
# Returns 4 rows.
FLU_FILTER_NESTED = '{"op": "and", "val": [' \
                    '   {"op": "ge", "col": "date", "val": "2013-11-01"},' \
                    '   {"op": "or", "val": [' + \
                            FLU_FILTER_SIMPLE + ', ' + \
                            FLU_FILTER_SIMPLE2 + \
                    '       ]' \
                    '   }' \
                    ']}'


def get_escaped_geojson(fname):
    pwd = os.path.dirname(os.path.realpath(__file__))
    rect_path = os.path.join(pwd, '../fixtures', fname)
    with open(rect_path, 'r') as rect_json:
        query_rect = rect_json.read()
    escaped_query_rect = urllib.parse.quote(query_rect)
    return escaped_query_rect


def get_loop_rect():
    return get_escaped_geojson('loop_rectangle.json')



# Path: tests/fixtures/base_test.py
# FIXTURE_PATH = pwd
# def ingest_point_fixture(fixture_meta, fname):
# def drop_tables(table_names):
#     def __init__(self, human_name, file_name):
#     def setUpClass(cls, shutdown=False):
#     def ingest_shapes(cls):
#     def ingest_points(cls):
#     def ingest_fixture(fixture):
#     def tearDownClass(cls):
# class ShapeFixture(object):
# class BasePlenarioTest(unittest.TestCase):


# Path: tests/test_api/test_point.py
import json
import os
import urllib.request, urllib.parse, urllib.error
import csv
from io import StringIO
from tests.fixtures.base_test import BasePlenarioTest, fixtures_path

                          FLU_FILTER_SIMPLE + ', ' + \
                          FLU_FILTER_SIMPLE2 + ']}'
# Returns 13 rows.
FLU_FILTER_COMPOUND_OR = FLU_BASE + '{"op": "or", "val": [' + \
                          FLU_FILTER_SIMPLE + ', ' + \
                          FLU_FILTER_SIMPLE2 + ']}'
# Returns 4 rows.
FLU_FILTER_NESTED = '{"op": "and", "val": [' \
                    '   {"op": "ge", "col": "date", "val": "2013-11-01"},' \
                    '   {"op": "or", "val": [' + \
                            FLU_FILTER_SIMPLE + ', ' + \
                            FLU_FILTER_SIMPLE2 + \
                    '       ]' \
                    '   }' \
                    ']}'


def get_escaped_geojson(fname):
    pwd = os.path.dirname(os.path.realpath(__file__))
    rect_path = os.path.join(pwd, '../fixtures', fname)
    with open(rect_path, 'r') as rect_json:
        query_rect = rect_json.read()
    escaped_query_rect = urllib.parse.quote(query_rect)
    return escaped_query_rect


def get_loop_rect():
    return get_escaped_geojson('loop_rectangle.json')



class PointAPITests(BasePlenarioTest):