Пример #1
0
    def test_session_post_with_files(self, _):
        fname, fobj = build_file()
        p = str(uuid.uuid4())

        result = self.plugit.do_query("test_session", method='POST', session={'test': p}, files={'test': fobj}).json()
        os.unlink(fname)
        assert result['x-plugitsession-test'] == p
        assert result['cookie-test'] == p
Пример #2
0
    def test_additional_headers_post_with_files(self, _):
        fname, fobj = build_file()
        p = str(uuid.uuid4())

        result = self.plugit.do_query("test_additional_headers", method='POST', additional_headers={'test': p},
                                      files={'test': fobj}).json()
        os.unlink(fname)
        assert result['x-plugit-test'] == p
Пример #3
0
 def test_post_postparam_list_with_files(self, _):
     fname, fobj = build_file()
     p = [str(uuid.uuid4()), str(uuid.uuid4())]
     result = self.plugit.do_query("test_post_list", method='POST', body={'post_param': p},
                                   files={'test': fobj}).json()
     os.unlink(fname)
     assert result['method'] == 'POST'
     assert result['post_param'] == p
Пример #4
0
 def test_post_getparam_with_files(self, _):
     fname, fobj = build_file()
     p = str(uuid.uuid4())
     result = self.plugit.do_query("test_post", method='POST', query_string={'get_param': p},
                                   files={'test': fobj}).json()
     os.unlink(fname)
     assert result['method'] == 'POST'
     assert result['get_param'] == p
    def test_additional_headers_post_with_files(self, _):
        fname, fobj = build_file()
        p = str(uuid.uuid4())

        result = self.plugit.do_query("test_additional_headers",
                                      method='POST',
                                      additional_headers={
                                          'test': p
                                      },
                                      files={
                                          'test': fobj
                                      }).json()
        os.unlink(fname)
        assert result['x-plugit-test'] == p
 def test_post_postparam_list_with_files(self, _):
     fname, fobj = build_file()
     p = [str(uuid.uuid4()), str(uuid.uuid4())]
     result = self.plugit.do_query("test_post_list",
                                   method='POST',
                                   body={
                                       'post_param': p
                                   },
                                   files={
                                       'test': fobj
                                   }).json()
     os.unlink(fname)
     assert result['method'] == 'POST'
     assert result['post_param'] == p
 def test_post_getparam_with_files(self, _):
     fname, fobj = build_file()
     p = str(uuid.uuid4())
     result = self.plugit.do_query("test_post",
                                   method='POST',
                                   query_string={
                                       'get_param': p
                                   },
                                   files={
                                       'test': fobj
                                   }).json()
     os.unlink(fname)
     assert result['method'] == 'POST'
     assert result['get_param'] == p
    def test_session_post_with_files(self, _):
        fname, fobj = build_file()
        p = str(uuid.uuid4())

        result = self.plugit.do_query("test_session",
                                      method='POST',
                                      session={
                                          'test': p
                                      },
                                      files={
                                          'test': fobj
                                      }).json()
        os.unlink(fname)
        assert result['x-plugitsession-test'] == p
        assert result['cookie-test'] == p