mirror of
https://github.com/bvanroll/python-vault-db.git
synced 2025-08-29 03:52:40 +00:00
ok, now we use testpypi
This commit is contained in:
2
.github/workflows/python-publish.yml
vendored
2
.github/workflows/python-publish.yml
vendored
@@ -28,4 +28,4 @@ jobs:
|
|||||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
python setup.py sdist bdist_wheel
|
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()
|
long_description = fh.read()
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="vaultdatabaseengine-bvanroll", # Replace with your own username
|
name="vault-db-bvanroll", # Replace with your own username
|
||||||
version="0.0.1",
|
version="0.0.1",
|
||||||
author="Beppe Vanrolleghem",
|
author="Beppe Vanrolleghem",
|
||||||
author_email="beppe.vanrolleghem@gmail.com",
|
author_email="beppe.vanrolleghem@gmail.com",
|
||||||
@@ -23,4 +23,4 @@ setuptools.setup(
|
|||||||
package_dir={"": "vaultdatabaseengine"},
|
package_dir={"": "vaultdatabaseengine"},
|
||||||
packages=setuptools.find_packages(where="src"),
|
packages=setuptools.find_packages(where="src"),
|
||||||
python_requires=">=3.6",
|
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