Esempio n. 1
0
 def test_postgresql_host_port_user_pass(self):
     uri = "postgresql://*****:*****@192.168.1.23:123/test"
     self.assertDictEqual(dict(scheme="postgresql",
         username = '******',
         password = '******',
         host = '192.168.1.23',
         port = 123,
         database = 'test'),
         parser(uri))
Esempio n. 2
0
 def test_postgresql_user_port(self):
     uri = "postgresql://user@:123/test"
     self.assertDictEqual(dict(scheme="postgresql",
         username = '******',
         password = self.password,
         host = self.host,
         port = 123,
         database = 'test'),
         parser(uri))
Esempio n. 3
0
 def test_postgresql_port_pass(self):
     uri = "postgresql://:password@:123/test"
     self.assertDictEqual(dict(scheme="postgresql",
         username = self.user,
         password = '******',
         host = self.host,
         port = 123,
         database = 'test'),
         parser(uri))
Esempio n. 4
0
 def test_postgresql_user_host(self):
     uri = "postgresql://[email protected]/test"
     self.assertDictEqual(dict(scheme="postgresql",
         username = '******',
         password = self.password,
         host = '192.168.1.23',
         port = self.port,
         database = 'test'),
         parser(uri))
Esempio n. 5
0
 def test_postgresql_user_pass(self):
     uri = "postgresql://*****:*****@/test"
     self.assertDictEqual(dict(scheme="postgresql",
         username = '******',
         password = '******',
         host = self.host,
         port = self.port,
         database = 'test'),
         parser(uri))
Esempio n. 6
0
 def test_postgresql_host_port(self):
     uri = "postgresql://192.168.1.23:123/test"
     self.assertDictEqual(dict(scheme="postgresql",
         username = self.user,
         password = self.password,
         host = '192.168.1.23',
         port = 123,
         database = 'test'),
         parser(uri))
Esempio n. 7
0
 def test_postgresql(self):
     uri = "postgresql:///test"
     self.assertDictEqual(dict(scheme="postgresql",
         username = self.user,
         password = self.password,
         host = self.host,
         port = self.port,
         database = 'test'),
         parser(uri))
Esempio n. 8
0
 def test_mysql_host__pass(self):
     uri = "mysql://:[email protected]/test"
     self.assertDictEqual(dict(scheme="mysql",
         username = '******',
         password = '******',
         host = '192.168.1.23',
         port = 3306,
         database = 'test'),
         parser(uri))
Esempio n. 9
0
 def test_mysql_port_pass(self):
     uri = "mysql://:password@:123/test"
     self.assertDictEqual(dict(scheme="mysql",
         username = '******',
         password = '******',
         host = 'localhost',
         port = 123,
         database = 'test'),
         parser(uri))
Esempio n. 10
0
 def test_mysql(self):
     uri = "mysql:///test"
     self.assertDictEqual(dict(scheme="mysql",
         username = '******',
         password = '',
         host = 'localhost',
         port = 3306,
         database = 'test'),
         parser(uri))
Esempio n. 11
0
 def test_mysql_user_port(self):
     uri = "mysql://user@:123/test"
     self.assertDictEqual(dict(scheme="mysql",
         username = '******',
         password = '',
         host = 'localhost',
         port = 123,
         database = 'test'),
         parser(uri))
Esempio n. 12
0
 def test_mysql_user_host(self):
     uri = "mysql://[email protected]/test"
     self.assertDictEqual(dict(scheme="mysql",
         username = '******',
         password = '',
         host = '192.168.1.23',
         port = 3306,
         database = 'test'),
         parser(uri))
Esempio n. 13
0
 def test_mysql_user_pass(self):
     uri = "mysql://*****:*****@/test"
     self.assertDictEqual(dict(scheme="mysql",
         username = '******',
         password = '******',
         host = 'localhost',
         port = 3306,
         database = 'test'),
         parser(uri))
Esempio n. 14
0
 def test_mysql_host_port(self):
     uri = "mysql://192.168.1.23:123/test"
     self.assertDictEqual(dict(scheme="mysql",
         username = '******',
         password = '',
         host = '192.168.1.23',
         port = 123,
         database = 'test'),
         parser(uri))
Esempio n. 15
0
 def test_unknow_scheme(self):
     with self.assertRaisesRegex(InvalidURI,r'unknow database') as a:
         parser('sqlit:///test')
Esempio n. 16
0
 def test_not_a_scheme(self):
     with self.assertRaisesRegex(InvalidURI,r'must have a database uri') as a:
         parser(':adf/test')
Esempio n. 17
0
 def test_without_datebase(self):
     with self.assertRaisesRegex(InvalidURI,r"need to point out the db's name") as a:
         parser('mysql://')