<s> import unittest <EOL> from fixtures . fakes import FakeGetView <EOL> from aiorest_ws . endpoints import PlainEndpoint , DynamicEndpoint <EOL> from aiorest_ws . exceptions import EndpointValueError <EOL> from aiorest_ws . parsers import URLParser <EOL> class URLParserTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( URLParserTestCase , self ) . setUp ( ) <EOL> self . parser = URLParser ( ) <EOL> def test_parse_static_url ( self ) : <EOL> route = self . parser . define_route ( '<STR_LIT>' , FakeGetView , '<STR_LIT:GET>' ) <EOL> self . assertIsInstance ( route , PlainEndpoint ) <EOL> def test_parse_dynamic_url ( self ) : <EOL> route = self . parser . define_route ( '<STR_LIT>' , FakeGetView , '<STR_LIT:GET>' ) <EOL> self . assertIsInstance ( route , DynamicEndpoint ) <EOL> def test_parse_invalid_url_1 ( self ) : <EOL> self . assertRaises ( <EOL> EndpointValueError , <EOL> self . parser . define_route , '<STR_LIT>' , FakeGetView , '<STR_LIT:GET>' <EOL> ) <EOL> def test_parse_invalid_url_2 ( self ) : <EOL> self . assertRaises ( <EOL> EndpointValueError , <EOL> self . parser . define_route , <EOL> '<STR_LIT>' , FakeGetView , '<STR_LIT:GET>' <EOL> ) <EOL> def test_parse_invalid_url_3 ( self ) : <EOL> self . assertRaises ( <EOL> EndpointValueError , <EOL> self . parser . define_route , <EOL> '<STR_LIT>' , FakeGetView , '<STR_LIT:GET>' <EOL> ) <EOL> def test_parse_invalid_url_4 ( self ) : <EOL> self . assertRaises ( <EOL> EndpointValueError , <EOL> self . parser . define_route , <EOL> '<STR_LIT>' , FakeGetView , '<STR_LIT:GET>' <EOL> ) <EOL> def test_parse_invalid_url_5 ( self ) : <EOL> self . assertRaises ( <EOL> EndpointValueError , <EOL> self . parser . define_route , <EOL> r"<STR_LIT>" , FakeGetView , '<STR_LIT:GET>' <EOL> ) </s>
