~ubuntu-branches/ubuntu/karmic/pypy/karmic

« back to all changes in this revision

Viewing changes to pypy/translator/js/lib/test/test_url.py

  • Committer: Bazaar Package Importer
  • Author(s): Alexandre Fayolle
  • Date: 2007-04-13 09:33:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070413093309-yoojh4jcoocu2krz
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
from pypy.translator.js.lib.url import parse_url
 
3
 
 
4
def test_url():
 
5
    assert parse_url("path") == (["path"], {})
 
6
    assert parse_url("a/b/c/d") == (["a", "b", "c", "d"], {})
 
7
    assert parse_url("/a/b") == (["a", "b"], {})
 
8
    assert parse_url("/a/b/c/") == (["a", "b", "c"], {})
 
9
    assert parse_url("a/b?q=a&c=z") == (["a","b"], {"q":"a", "c":"z"})
 
10
    got = parse_url('/get_message?sid=2ed&pid=-1')
 
11
    assert got == (["get_message"], {'pid':'-1', 'sid':'2ed'})