Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (16 sloc) 0.867 kb
# -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from .fake_webapp import EXAMPLE_APP
from splinter.request_handler.status_code import HttpResponseError
class StatusCodeTest(object):
def test_should_visit_an_absent_page_and_get_an_404_error(self):
with self.assertRaises(HttpResponseError):
self.browser.visit(EXAMPLE_APP + "this_page_does_not_exists")
def test_should_visit_index_of_example_app_and_get_200_status_code(self):
self.browser.visit(EXAMPLE_APP)
self.assertEqual(200, self.browser.status_code)
def test_should_be_able_to_print_status_code_with_reason(self):
self.browser.visit(EXAMPLE_APP)
self.assertEqual('200 - OK', str(self.browser.status_code))
Jump to Line
Something went wrong with that request. Please try again.