11 Commits
0.0.3 ... 0.1.0

4 changed files with 12 additions and 7 deletions

3
TODO.md Normal file
View File

@@ -0,0 +1,3 @@
# TODO
1: add proper versioning (usage of tags during publish pipeline)

View File

@@ -4,8 +4,10 @@ with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read() long_description = fh.read()
setuptools.setup( setuptools.setup(
name="vault-db-bvanroll", # Replace with your own username name="vaultdb",
version="0.0.1", version="0.0.1",
version_config=True,
setup_requires=['setuptools-git-versioning'],
author="Beppe Vanrolleghem", author="Beppe Vanrolleghem",
author_email="beppe.vanrolleghem@gmail.com", author_email="beppe.vanrolleghem@gmail.com",
description="A vault creds reader for the vault database engine", description="A vault creds reader for the vault database engine",
@@ -20,7 +22,7 @@ setuptools.setup(
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Operating System :: OS Independent", "Operating System :: OS Independent",
], ],
package_dir={"": "vaultdatabaseengine"}, package_dir={"": "src"},
packages=setuptools.find_packages(where="src"), packages=setuptools.find_packages(where="src"),
python_requires=">=3.6", python_requires=">=3.6",
) )

View File

@@ -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())