~certify-web-dev/storm/certify-staging

« back to all changes in this revision

Viewing changes to tests/uri.py

  • Committer: Gustavo Niemeyer
  • Date: 2008-01-30 13:03:27 UTC
  • mto: This revision was merged to the branch mainline in revision 214.
  • Revision ID: gustavo@niemeyer.net-20080130130327-9qyfhp6tm589hv83
Implemented URI.__str__, based on ideas from Jamu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
        self.assertTrue(uri_copy is not uri)
146
146
        self.assertTrue(uri_copy.__dict__ == uri.__dict__)
147
147
        self.assertTrue(uri_copy.options is not uri.options)
 
148
 
 
149
    def str(self, uri):
 
150
        self.assertEquals(str(URI(uri)), uri)
 
151
 
 
152
    def test_str_full_with_escaping(self):
 
153
        self.str("scheme://us%2Fer:pa%2Fss@ho%2Fst:0/d%3Fb?a%2Fb=c%2Fd&ghi=jkl")
 
154
 
 
155
    def test_str_no_path_escaping(self):
 
156
        self.str("scheme:/a/b/c")
 
157
 
 
158
    def test_str_scheme_only(self):
 
159
        self.str("scheme:")
 
160
 
 
161
    def test_str_username_only(self):
 
162
        self.str("scheme://username@/")
 
163
 
 
164
    def test_str_password_only(self):
 
165
        self.str("scheme://:password@/")
 
166
 
 
167
    def test_str_port_only(self):
 
168
        self.str("scheme://:0/")
 
169
 
 
170
    def test_str_host_only(self):
 
171
        self.str("scheme://host/")
 
172
 
 
173
    def test_str_database_only(self):
 
174
        self.str("scheme:db")
 
175
 
 
176
    def test_str_option_only(self):
 
177
        self.str("scheme:?a=b")
 
178