예제 #1
0
 def test_multiple_slash_strings(self):
     parser = hurl.Parser()
     input_text = "blog/author/john/smith"
     expected_result = [
         hurl.StaticPart('blog'),
         hurl.StaticPart('author'),
         hurl.StaticPart('john'),
         hurl.StaticPart('smith')
     ]
     result = parser.parse(input_text)
     self.assertEquals(result, expected_result)
예제 #2
0
 def test_string_slash_parameter_only_type(self):
     parser = hurl.Parser()
     input_text = "<:int>/blog/"
     expected_result = [
         hurl.PatternPart(type='int'),
         hurl.StaticPart('blog')
     ]
     result = parser.parse(input_text)
     self.assertEquals(result, expected_result)
예제 #3
0
 def test_string_slash_parameter(self):
     parser = hurl.Parser()
     input_text = "blog/<day>"
     expected_result = [
         hurl.StaticPart('blog'),
         hurl.PatternPart(name='day')
     ]
     result = parser.parse(input_text)
     self.assertEquals(result, expected_result)
예제 #4
0
 def test_string_slash_pattern(self):
     parser = hurl.Parser()
     input_text = "blog/authors"
     expected_result = [hurl.StaticPart('blog'), hurl.StaticPart('authors')]
     result = parser.parse(input_text)
     self.assertEquals(result, expected_result)
예제 #5
0
 def test_simple_string_is_expression(self):
     parser = hurl.Parser()
     input_text = "entries"
     expected_result = [hurl.StaticPart('entries')]
     result = parser.parse(input_text)
     self.assertEquals(result, expected_result)