Skip to content

Commit

Permalink
Create test_secrets_manager.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Sep 18, 2024
1 parent 6c02e6e commit 10439aa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions app/tests/test_secrets_manager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import unittest
from app.secrets_manager import SecretsManager
import os

class TestSecretsManager(unittest.TestCase):
def setUp(self):
self.secrets_file = 'secrets.json'
self.secrets_manager = SecretsManager(self.secrets_file)

def test_get_secret(self):
self.secrets_manager.set_secret('mysecret', 'myvalue')
self.assertEqual(self.secrets_manager.get_secret('mysecret'), 'myvalue')

def test_set_secret(self):
self.secrets_manager.set_secret('mysecret', 'myvalue')
self.assertEqual(self.secrets_manager.get_secret('mysecret'), 'myvalue')

def tearDown(self):
if os.path.exists(self.secrets_file):
os.remove(self.secrets_file)

if __name__ == '__main__':
unittest.main()

0 comments on commit 10439aa

Please sign in to comment.