mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Restructured libraries
This commit is contained in:
@@ -11,7 +11,7 @@ sys.path.insert(0, dir_path)
|
||||
|
||||
# Import functions and classes to test
|
||||
from cli.create.credentials import ask_for_confirmation, main
|
||||
from utils.handler.vault import VaultHandler, VaultScalar
|
||||
from module_utils.handler.vault import VaultHandler, VaultScalar
|
||||
import subprocess
|
||||
import tempfile
|
||||
import yaml
|
||||
|
@@ -14,9 +14,9 @@ sys.path.insert(
|
||||
),
|
||||
)
|
||||
|
||||
from utils.handler.yaml import YamlHandler
|
||||
from utils.handler.vault import VaultHandler, VaultScalar
|
||||
from utils.manager.inventory import InventoryManager
|
||||
from module_utils.handler.yaml import YamlHandler
|
||||
from module_utils.handler.vault import VaultHandler, VaultScalar
|
||||
from module_utils.manager.inventory import InventoryManager
|
||||
|
||||
|
||||
class TestInventoryManager(unittest.TestCase):
|
||||
|
@@ -34,10 +34,10 @@ class TestGetAllInvokableApps(unittest.TestCase):
|
||||
"invokable": True
|
||||
},
|
||||
"util": {
|
||||
"title": "Utils",
|
||||
"title": "module_utils",
|
||||
"invokable": False,
|
||||
"desk": {
|
||||
"title": "Desktop Utils",
|
||||
"title": "Desktop module_utils",
|
||||
"invokable": True
|
||||
}
|
||||
}
|
||||
|
@@ -1,26 +0,0 @@
|
||||
import unittest
|
||||
from filter_plugins.get_public_id import FilterModule
|
||||
|
||||
class TestGetPublicId(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.filter = FilterModule().filters()['get_public_id']
|
||||
|
||||
def test_extract_public_id(self):
|
||||
self.assertEqual(self.filter("svc-user-abc123"), "abc123")
|
||||
self.assertEqual(self.filter("something-simple-xyz"), "xyz")
|
||||
self.assertEqual(self.filter("a-b-c-d-e"), "e")
|
||||
|
||||
def test_no_hyphen(self):
|
||||
with self.assertRaises(ValueError):
|
||||
self.filter("nohyphenhere")
|
||||
|
||||
def test_non_string_input(self):
|
||||
with self.assertRaises(ValueError):
|
||||
self.filter(12345)
|
||||
|
||||
def test_empty_string(self):
|
||||
with self.assertRaises(ValueError):
|
||||
self.filter("")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
@@ -1,5 +1,5 @@
|
||||
import unittest
|
||||
from utils.dict_renderer import DictRenderer
|
||||
from module_utils.dict_renderer import DictRenderer
|
||||
|
||||
class TestDictRenderer(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
@@ -1,9 +1,9 @@
|
||||
# File: tests/unit/utils/test_valid_deploy_id.py
|
||||
# File: tests/unit/module_utils/test_valid_deploy_id.py
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
import yaml
|
||||
from utils.valid_deploy_id import ValidDeployId
|
||||
from module_utils.valid_deploy_id import ValidDeployId
|
||||
|
||||
class TestValidDeployId(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
Reference in New Issue
Block a user