def test_method_can_be_CONNECT(): assert Method("CONNECT") == u"CONNECT"

def test_method_can_be_big():
def test_method_can_be_DELETE():  assert Method("DELETE")  == u"DELETE"
def test_method_can_be_TRACE():   assert Method("TRACE")   == u"TRACE"
def test_method_can_be_TRACE():   assert Method("TRACE")   == u"TRACE"
def test_method_can_be_CONNECT(): assert Method("CONNECT") == u"CONNECT"
def test_method_can_be_POST():    assert Method("POST")    == u"POST"
def test_method_can_be_PUT():     assert Method("PUT")     == u"PUT"
def test_method_can_be_PUT():     assert Method("PUT")     == u"PUT"
def test_method_can_be_DELETE():  assert Method("DELETE")  == u"DELETE"
def test_method_works():
    method = Method("GET")
    assert method == u"GET", method
def test_method_can_be_HEAD():    assert Method("HEAD")    == u"HEAD"
def test_method_can_be_POST():    assert Method("POST")    == u"POST"
def test_method_cant_have_more_attributes():
    method = Method("GET")
    assert_raises(AttributeError, setattr, method, "foo", "bar")
def test_method_can_be_OPTIONS(): assert Method("OPTIONS") == u"OPTIONS"
def test_method_can_be_GET():     assert Method("GET")     == u"GET"
def test_method_raw_works():
    method = Method("GET")
    assert method.raw == "GET", method.raw
def test_method_raw_is_bytestring():
    method = Method("GET")
    assert isinstance(method.raw, str), method.raw
def test_method_is_basestring_instance():
    method = Method("GET")
    assert isinstance(method, basestring), method
def test_method_is_unicode_instance():
    method = Method("GET")
    assert isinstance(method, unicode), method
def test_method_is_unicode_subclass():
    method = Method("GET")
    assert issubclass(method.__class__, unicode), method.__class__
def test_method_can_be_big():
    big = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz--"
    assert Method(big) == big
def test_method_can_be_GET():     assert Method("GET")     == u"GET"
def test_method_can_be_HEAD():    assert Method("HEAD")    == u"HEAD"
def test_method_can_be_valid_perl():
    assert Method("!#$%&'*+-.^_`|~") == u"!#$%&'*+-.^_`|~"
Exemple #18
0
def test_method_no_chr_33(): assert Method(chr(33)) == '!'

# SEPARATORS
def test_method_no_chr_40(): the501(40) # (