Beispiel #1
0
 def testParseSerialize(self):
     scheme = "pq://"
     for x in iri_samples:
         px = pg_iri.parse(x)
         spx = pg_iri.serialize(px)
         pspx = pg_iri.parse(spx)
         self.failUnless(
             pspx == px, "parse-serialize incongruity, %r -> %r -> %r : %r != %r" % (x, px, spx, pspx, px)
         )
         spspx = pg_iri.serialize(pspx)
         self.failUnless(
             spx == spspx,
             "parse-serialize incongruity, %r -> %r -> %r -> %r : %r != %r" % (x, px, spx, pspx, spspx, spx),
         )
Beispiel #2
0
 def testParseSerialize(self):
     scheme = 'pq://'
     for x in iri_samples:
         px = pg_iri.parse(x)
         spx = pg_iri.serialize(px)
         pspx = pg_iri.parse(spx)
         self.assertTrue(
             pspx == px,
             "parse-serialize incongruity, %r -> %r -> %r : %r != %r" %
             (x, px, spx, pspx, px))
         spspx = pg_iri.serialize(pspx)
         self.assertTrue(
             spx == spspx,
             "parse-serialize incongruity, %r -> %r -> %r -> %r : %r != %r"
             % (x, px, spx, pspx, spspx, spx))
Beispiel #3
0
 def testPresentPasswordObscure(self):
     "password is *not* present in IRI, and do nothing"
     s = 'pq://user@host:port/dbname'
     o = 'pq://user@host:port/dbname'
     p = pg_iri.parse(s)
     ps = pg_iri.serialize(p, obscure_password=True)
     self.assertEqual(ps, o)
Beispiel #4
0
 def testPresentPasswordObscure(self):
     "password is present in IRI, and obscure it"
     s = 'pq://*****:*****@host:port/dbname'
     o = 'pq://*****:*****@host:port/dbname'
     p = pg_iri.parse(s)
     ps = pg_iri.serialize(p, obscure_password=True)
     self.assertEqual(ps, o)
Beispiel #5
0
 def testPresentPasswordObscure(self):
     "password is *not* present in IRI, and do nothing"
     s = "pq://user@host:port/dbname"
     o = "pq://user@host:port/dbname"
     p = pg_iri.parse(s)
     ps = pg_iri.serialize(p, obscure_password=True)
     self.failUnlessEqual(ps, o)
Beispiel #6
0
 def testPresentPasswordObscure(self):
     "password is present in IRI, and obscure it"
     s = "pq://*****:*****@host:port/dbname"
     o = "pq://*****:*****@host:port/dbname"
     p = pg_iri.parse(s)
     ps = pg_iri.serialize(p, obscure_password=True)
     self.failUnlessEqual(ps, o)
Beispiel #7
0
 def testSerializeParse(self):
     for x in sample_structured_parameters:
         xs = pg_iri.serialize(x)
         uxs = pg_iri.parse(xs)
         self.assertTrue(
             x == uxs, "serialize-parse incongruity, %r -> %r -> %r" % (
                 x,
                 xs,
                 uxs,
             ))
Beispiel #8
0
	def testSerializeParse(self):
		for x in sample_structured_parameters:
			xs = pg_iri.serialize(x)
			uxs = pg_iri.parse(xs)
			self.assertTrue(
				x == uxs,
				"serialize-parse incongruity, %r -> %r -> %r" %(
					x, xs, uxs,
				)
			)
Beispiel #9
0
	def testParseSerialize(self):
		scheme = 'pq://'
		for x in iri_samples:
			px = pg_iri.parse(x)
			spx = pg_iri.serialize(px)
			pspx = pg_iri.parse(spx)
			self.assertTrue(
				pspx == px,
				"parse-serialize incongruity, %r -> %r -> %r : %r != %r" %(
					x, px, spx, pspx, px
				)
			)
			spspx = pg_iri.serialize(pspx)
			self.assertTrue(
				spx == spspx,
				"parse-serialize incongruity, %r -> %r -> %r -> %r : %r != %r" %(
					x, px, spx, pspx, spspx, spx
				)
			)