mirror of
https://github.com/bvanroll/python-vault-db.git
synced 2025-08-29 20:12:43 +00:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
f6550a28bb |
2
.github/workflows/python-publish.yml
vendored
2
.github/workflows/python-publish.yml
vendored
@@ -28,4 +28,4 @@ jobs:
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
twine upload dist/*
|
||||
twine upload --repository testpypi dist/*
|
||||
|
4
setup.py
4
setup.py
@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
setuptools.setup(
|
||||
name="vaultdatabaseengine-bvanroll", # Replace with your own username
|
||||
name="vault-db-bvanroll", # Replace with your own username
|
||||
version="0.0.1",
|
||||
author="Beppe Vanrolleghem",
|
||||
author_email="beppe.vanrolleghem@gmail.com",
|
||||
@@ -23,4 +23,4 @@ setuptools.setup(
|
||||
package_dir={"": "vaultdatabaseengine"},
|
||||
packages=setuptools.find_packages(where="src"),
|
||||
python_requires=">=3.6",
|
||||
)
|
||||
)
|
||||
|
36
test/database.py
Normal file
36
test/database.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import unittest
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
import vaultdatabaseengine
|
||||
|
||||
class MyTestCase(unittest.TestCase):
|
||||
def test_psql(self):
|
||||
#TODO exec psql connect
|
||||
print("hi")
|
||||
test = vaultdatabaseengine.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")
|
||||
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")
|
||||
except:
|
||||
return
|
||||
|
||||
def test_psql_valid(self):
|
||||
print(vaultdatabaseengine.Database(dbname="psql", vault_url="http://localhost", token="s.GoR2nisHPeKU1vOaw9hZ5L7h").get_creds())
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Reference in New Issue
Block a user