Ejemplo n.º 1
0
 def testFTP(self):
     resp = connstr.parse('ftp://fff.sss.ggg')
     self.assertEqual('ftp', resp['protocol'])
     self.assertEqual(None, resp['user'])
     self.assertEqual(None, resp['password'])
     self.assertEqual('fff.sss.ggg', resp['host'])
     self.assertEqual(None, resp['port'])
Ejemplo n.º 2
0
 def testSQLite(self):
     resp = connstr.parse('sqlite:///var/log/journal.sqlite3')
     self.assertEqual('sqlite', resp['protocol'])
     self.assertEqual(None, resp['user'])
     self.assertEqual(None, resp['password'])
     self.assertEqual('/var/log/journal.sqlite3', resp['host'])
     self.assertEqual(None, resp['port'])
Ejemplo n.º 3
0
 def testPostgresPort(self):
     resp = connstr.parse('postgres://*****:*****@encoder001.fff.sss.ggg:123')
     self.assertEqual('postgres', resp['protocol'])
     self.assertEqual('feat', resp['user'])
     self.assertEqual('feat', resp['password'])
     self.assertEqual('encoder001.fff.sss.ggg', resp['host'])
     self.assertEqual(123, resp['port'])
Ejemplo n.º 4
0
 def testSQLiteDash(self):
     resp = connstr.parse(
         'sqlite:///home/thomas/credex/git/dev/release-1.5.x/'
         'feat/log/journal.sqlite3')
     self.assertEqual('sqlite', resp['protocol'])
     self.assertEqual(None, resp['user'])
     self.assertEqual(None, resp['password'])
     self.assertEqual('/home/thomas/credex/git/dev/release-1.5.x/'
         'feat/log/journal.sqlite3', resp['host'])
     self.assertEqual(None, resp['port'])
Ejemplo n.º 5
0
    def testParsingConnstr(self):
        resp = connstr.parse("ftp://fff.sss.ggg")
        self.assertEqual("ftp", resp["protocol"])
        self.assertEqual(None, resp["user"])
        self.assertEqual(None, resp["password"])
        self.assertEqual(None, resp["port"])
        self.assertEqual("fff.sss.ggg", resp["host"])

        resp = connstr.parse("postgres://*****:*****@encoder001.fff.sss.ggg")
        self.assertEqual("postgres", resp["protocol"])
        self.assertEqual("feat", resp["user"])
        self.assertEqual("feat", resp["password"])
        self.assertEqual(None, resp["port"])
        self.assertEqual("encoder001.fff.sss.ggg", resp["host"])

        resp = connstr.parse("sqlite:///var/log/journal.sqlite3")
        self.assertEqual("sqlite", resp["protocol"])
        self.assertEqual(None, resp["user"])
        self.assertEqual(None, resp["password"])
        self.assertEqual(None, resp["port"])
        self.assertEqual("/var/log/journal.sqlite3", resp["host"])