mirror of
https://github.com/bvanroll/python-vault-db.git
synced 2025-08-29 03:52:40 +00:00
if you change your config files to use the new dir, don't forget to actually set up the new dir
This commit is contained in:
@@ -2,32 +2,32 @@ import unittest
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||||
import vaultdatabaseengine
|
import src
|
||||||
|
|
||||||
class MyTestCase(unittest.TestCase):
|
class MyTestCase(unittest.TestCase):
|
||||||
def test_psql(self):
|
def test_psql(self):
|
||||||
#TODO exec psql connect
|
#TODO exec psql connect
|
||||||
print("hi")
|
print("hi")
|
||||||
test = vaultdatabaseengine.Database()
|
test = src.Database()
|
||||||
test.check_valid()
|
test.check_valid()
|
||||||
self.assertEqual(test.valid, False)
|
self.assertEqual(test.valid, False)
|
||||||
|
|
||||||
def test_psql_invalid_vault_url(self):
|
def test_psql_invalid_vault_url(self):
|
||||||
#TODO figure out how to fail unit test check
|
#TODO figure out how to fail unit test check
|
||||||
try:
|
try:
|
||||||
vaultdatabaseengine.Database(dbname="sdfk", vault_url="localhost", vault_port=8200, token="bla")
|
src.Database(dbname="sdfk", vault_url="localhost", vault_port=8200, token="bla")
|
||||||
except:
|
except:
|
||||||
print("did it")
|
print("did it")
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_psql_invalid_vault_port(self):
|
def test_psql_invalid_vault_port(self):
|
||||||
try:
|
try:
|
||||||
vaultdatabaseengine.Database(dbname="sdfk", vault_url="localhost", vault_port="a", token="bla")
|
src.Database(dbname="sdfk", vault_url="localhost", vault_port="a", token="bla")
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
def test_psql_valid(self):
|
def test_psql_valid(self):
|
||||||
print(vaultdatabaseengine.Database(dbname="psql", vault_url="http://localhost", token="s.GoR2nisHPeKU1vOaw9hZ5L7h").get_creds())
|
print(src.Database(dbname="psql", vault_url="http://localhost", token="s.GoR2nisHPeKU1vOaw9hZ5L7h").get_creds())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user