Пример #1
0
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import vertx
from test_utils import TestUtils
from core.buffer import Buffer

tu = TestUtils()
tu.check_context()
server = vertx.create_http_server()
client = vertx.create_http_client()
client.port = 8080
logger = vertx.get_logger()


# This is just a basic test. Most testing occurs in the Java tests
class HttpTest(object):
    def test_get(self):
        http_method(False, "GET", False)

    def test_get_ssl(self):
        http_method(True, "GET", False)

    def test_put(self):
Пример #2
0
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import vertx
from test_utils import TestUtils
from core.buffer import Buffer

tu = TestUtils()
tu.check_context()

server = vertx.create_http_server()
client = vertx.create_http_client()
client.port = 8080

class WebsocketTest(object):
    def test_echo_binary(self):
        self.echo(True)

    def test_echo_text(self):
        self.echo(False)

    def echo(self, binary):
        @server.websocket_handler
        def websocket_handler(ws):