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:
2021-03-24 09:43:51 +01:00
parent b2c7772ca1
commit afd725d5b4
3 changed files with 5 additions and 5 deletions

View File

@@ -2,32 +2,32 @@ import unittest
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import vaultdatabaseengine
import src
class MyTestCase(unittest.TestCase):
def test_psql(self):
#TODO exec psql connect
print("hi")
test = vaultdatabaseengine.Database()
test = src.Database()
test.check_valid()
self.assertEqual(test.valid, False)
def test_psql_invalid_vault_url(self):
#TODO figure out how to fail unit test check
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:
print("did it")
return
def test_psql_invalid_vault_port(self):
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:
return
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())