# Path: sectesting/streetart/tests/cases/base.py
# class BaseViewVerbTestCase(BaseViewTestCase):
#     """
#     This is a base class for all test cases that run tests on a view and a verb specified within the
#     test case constructor.
#     """
# 
#     def __init__(self, verb=None, *args, **kwargs):
#         self.verb = verb
#         super(BaseViewVerbTestCase, self).__init__(*args, **kwargs)


from .base import BaseViewVerbTestCase
from __future__ import absolute_import



class HeaderKeyExistsTestCase(BaseViewVerbTestCase):
    """
    This is a test case for testing whether or not a header key is contained within all of the HTTP
    responses returned by the Street Art project.
    """

    def __init__(self, header_key=None, *args, **kwargs):
        self.header_key = header_key
        super(HeaderKeyExistsTestCase, self).__init__(*args, **kwargs)

    def runTest(self):
        """
        Tests that the HTTP response received from the view contains a header corresponding to
        self.header_key.
        :return: None
        """
        requestor = self._get_requestor_for_view(self.view)
        response = requestor.send_request_by_verb(self.verb, user_string="user_1")
        self._assert_response_has_header_key(
            response=response,
            header_key=self.header_key,
            message="Response from view %s with verb %s did not contain header key of %s. Keys were %s."
            % (self.view, self.verb, self.header_key, response._headers.keys())
        )



# Path: sectesting/streetart/tests/cases/base.py
# class BaseViewVerbTestCase(BaseViewTestCase):
#     """
#     This is a base class for all test cases that run tests on a view and a verb specified within the
#     test case constructor.
#     """
# 
#     def __init__(self, verb=None, *args, **kwargs):
#         self.verb = verb
#         super(BaseViewVerbTestCase, self).__init__(*args, **kwargs)


# Path: sectesting/streetart/tests/cases/headers.py
from .base import BaseViewVerbTestCase

from __future__ import absolute_import



class HeaderKeyExistsTestCase(BaseViewVerbTestCase):
    """
    This is a test case for testing whether or not a header key is contained within all of the HTTP
    responses returned by the Street Art project.
    """

    def __init__(self, header_key=None, *args, **kwargs):
        self.header_key = header_key
        super(HeaderKeyExistsTestCase, self).__init__(*args, **kwargs)

    def runTest(self):
        """
        Tests that the HTTP response received from the view contains a header corresponding to
        self.header_key.
        :return: None
        """
        requestor = self._get_requestor_for_view(self.view)
        response = requestor.send_request_by_verb(self.verb, user_string="user_1")
        self._assert_response_has_header_key(
            response=response,
            header_key=self.header_key,
            message="Response from view %s with verb %s did not contain header key of %s. Keys were %s."
            % (self.view, self.verb, self.header_key, response._headers.keys())
        )



class HeaderValueAccurateTestCase(BaseViewVerbTestCase):