# Path: yql/utils.py
# def get_http_method(query):
#     """Work out if this should be GET, POST, PUT or DELETE"""
#     lower_query = query.strip().lower()
# 
#     http_method = "GET"
#     for method in METHOD_MAP:
#         if method[0] in lower_query:
#             http_method = method[1]
#             break
# 
#     return http_method


from unittest import TestCase
from yql.utils import get_http_method



class UtilitiesTest(TestCase):
    def test_finds_get_method_for_select_query(self):
        self.assertEqual(get_http_method("SELECT foo"), "GET")

    def test_finds_get_method_for_select_query_with_leading_space(self):
        self.assertEqual(get_http_method(" SELECT foo"), "GET")

    def test_finds_get_method_for_lowercase_select_query(self):

# Path: yql/utils.py
# def get_http_method(query):
#     """Work out if this should be GET, POST, PUT or DELETE"""
#     lower_query = query.strip().lower()
# 
#     http_method = "GET"
#     for method in METHOD_MAP:
#         if method[0] in lower_query:
#             http_method = method[1]
#             break
# 
#     return http_method


# Path: yql/tests/test_utilities.py
from unittest import TestCase
from yql.utils import get_http_method




class UtilitiesTest(TestCase):
    def test_finds_get_method_for_select_query(self):
        self.assertEqual(get_http_method("SELECT foo"), "GET")

    def test_finds_get_method_for_select_query_with_leading_space(self):
        self.assertEqual(get_http_method(" SELECT foo"), "GET")

    def test_finds_get_method_for_lowercase_select_query(self):

        self.assertEqual(get_http_method("select foo"), "GET")