コード例 #1
0
ファイル: test_api_middleware.py プロジェクト: vbansal22/deis
 def test_x_deis_version_header_good(self):
     """
     Test that when the version header is sent, the request is accepted.
     """
     response = self.client.get('/api/apps',
                                HTTP_X_DEIS_VERSION=__version__.rsplit(
                                    '.', 1)[0])
     self.assertEqual(response.status_code, 200)
コード例 #2
0
 def test_x_deis_version_header_good(self):
     """
     Test that when the version header is sent, the request is accepted.
     """
     response = self.client.get(
         '/api/apps',
         HTTP_X_DEIS_VERSION=__version__.rsplit('.', 1)[0]
     )
     self.assertEqual(response.status_code, 200)
コード例 #3
0
 def test_x_deis_version_header_good(self):
     """
     Test that when the version header is sent, the request is accepted.
     """
     response = self.client.get(
         "/v1/apps",
         HTTP_X_DEIS_VERSION=__version__.rsplit(".", 1)[0],
         HTTP_AUTHORIZATION="token {}".format(self.token),
     )
     self.assertEqual(response.status_code, 200)
コード例 #4
0
ファイル: test_api_middleware.py プロジェクト: baseboxorg/deo
 def test_x_deis_version_header_good(self):
     """
     Test that when the version header is sent, the request is accepted.
     """
     response = self.client.get(
         '/v1/apps',
         HTTP_X_DEIS_VERSION=__version__.rsplit('.', 1)[0],
         HTTP_AUTHORIZATION='token {}'.format(self.token),
     )
     self.assertEqual(response.status_code, 200)
コード例 #5
0
ファイル: middleware.py プロジェクト: bdemers/deis
 def process_request(self, request):
     try:
         # server and client version must match "x.y"
         client_version = request.META["HTTP_X_DEIS_VERSION"]
         server_version = __version__.rsplit(".", 1)[0]
         if client_version != server_version:
             message = {
                 "error": "Client and server versions do not match. "
                 + "Client version: {} ".format(client_version)
                 + "Server version: {}".format(server_version)
             }
             return HttpResponse(
                 json.dumps(message), content_type="application/json", status=status.HTTP_405_METHOD_NOT_ALLOWED
             )
     except KeyError:
         pass
コード例 #6
0
ファイル: middleware.py プロジェクト: fbatroni/deis
 def process_request(self, request):
     try:
         # server and client version must match "x.y"
         client_version = request.META['HTTP_X_DEIS_VERSION']
         server_version = __version__.rsplit('.', 1)[0]
         if client_version != server_version:
             message = {
                 'error': 'Client and server versions do not match.\n' +
                 'Client version: {}\n'.format(client_version) +
                 'Server version: {}'.format(server_version)
             }
             return HttpResponse(
                 json.dumps(message),
                 content_type='application/json',
                 status=status.HTTP_405_METHOD_NOT_ALLOWED
             )
     except KeyError:
         pass
コード例 #7
0
ファイル: middleware.py プロジェクト: vbansal22/deis
 def process_request(self, request):
     try:
         # server and client version must match "x.y"
         client_version = request.META['HTTP_X_DEIS_VERSION']
         server_version = __version__.rsplit('.', 1)[0]
         if client_version != server_version:
             message = {
                 'error': 'Client and server versions do not match. ' +
                 'Client version: {} '.format(client_version) +
                 'Server version: {}'.format(server_version)
             }
             return HttpResponse(
                 json.dumps(message),
                 content_type='application/json',
                 status=status.HTTP_405_METHOD_NOT_ALLOWED
             )
     except KeyError:
         pass
コード例 #8
0
ファイル: conf.py プロジェクト: AnyBucket-Lab/deis
# The master toctree document.
master_doc = 'toctree'

# General information about the project.
project = u'deis'
copyright = u'2013, OpDemand LLC'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from deis import __version__

# The short X.Y version.
version = __version__.rsplit('.', 1)[0]
# The full version, including alpha/beta/rc tags.
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
コード例 #9
0
# The master toctree document.
master_doc = 'toctree'

# General information about the project.
project = u'deis'
copyright = u'2013, 2014 Engine Yard, Inc.'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from deis import __version__

# The short X.Y version.
version = __version__.rsplit('.', 1)[0]
# The full version, including alpha/beta/rc tags.
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
コード例 #10
0
ファイル: conf.py プロジェクト: laurrentt/deis
# The master toctree document.
master_doc = "toctree"

# General information about the project.
project = u"deis"
copyright = u"2013, 2014 Engine Yard, Inc."

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from deis import __version__

# The short X.Y version.
version = __version__.rsplit(".", 1)[0]
# The full version, including alpha/beta/rc tags.
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.