Exemple #1
0
 def create_chains(self):
     self.ch_enabled = chains.base(uri='/page.html')
     self.ch_enabled.server_response = chains.make_response(404,
                                                            expected=False)
     self.ch_enabled.response = chains.make_response(404)
     self.ch_disabled = chains.base()
     # Make 200 status expected once for transition purpose.
     self.trans_resp = self.ch_disabled.response
     self.ch_disabled.response = chains.make_502_expected()
Exemple #2
0
    def __init__(self, *args, **kwargs):
        deproxy.Deproxy.__init__(self, *args, **kwargs)
        base = self.create_base()
        base[0].server_response.headers['Content-Length'] = "invalid"
        base[0].server_response.build_message()

        base[0].response = chains.make_502_expected()

        self.message_chains = [base[0]]
        self.cookies = []
Exemple #3
0
    def __init__(self, *args, **kwargs):
        deproxy.Deproxy.__init__(self, *args, **kwargs)
        base = self.create_base()
        base[0].server_response.headers.delete_all('Content-Length')
        base[0].server_response.headers.add('Content-Length', "%i" % base[1])
        base[0].server_response.build_message()

        base[0].response = chains.make_502_expected()

        self.message_chains = [base[0]]
        self.cookies = []
Exemple #4
0
    def __init__(self, *args, **kwargs):
        deproxy.Deproxy.__init__(self, *args, **kwargs)
        base = self.create_base()
        cl = base[0].server_response.headers['Content-Length']
        length = int(cl)
        base[0].server_response.headers.add('Content-Length',
                                            "%i" % (length - 1))
        base[0].server_response.build_message()

        base[0].response = chains.make_502_expected()

        self.message_chains = [base[0]]
        self.cookies = []
Exemple #5
0
 def test_no_crlf_before_body(self):
     chain = chains.proxy()
     chain.server_response.msg = chain.server_response.msg.replace('\r\n\r\n', '\r\n', 1)
     chain.response = chains.make_502_expected()
     self.generic_test_routine(self.config, [chain])
Exemple #6
0
 def test_204_with_body(self):
     chain = chains.proxy()
     chain.server_response.status = '204'
     chain.server_response.build_message()
     chain.response = chains.make_502_expected()
     self.generic_test_routine(self.config, [chain])