Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12870659
test_utils.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
test_utils.py
View Options
# -------------------------------------------------------------
# Secretsmith :: Vault :: Utilities
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: BSD-2-Clause
# -------------------------------------------------------------
import
unittest
from
secretsmith.vault.utils
import
split_path
class
TestUtils
(
unittest
.
TestCase
):
def
test_split_path_basic
(
self
):
full_path
=
"mount/secret/path/to/data"
expected
=
(
"mount"
,
"secret/path/to/data"
)
self
.
assertEqual
(
expected
,
split_path
(
full_path
))
def
test_split_path_no_secret_path
(
self
):
full_path
=
"mount"
expected
=
(
"mount"
,
""
)
self
.
assertEqual
(
expected
,
split_path
(
full_path
))
def
test_split_path_leading_slash
(
self
):
full_path
=
"/mount/secret/path"
expected
=
(
""
,
"mount/secret/path"
)
self
.
assertEqual
(
expected
,
split_path
(
full_path
))
def
test_split_path_trailing_slash
(
self
):
full_path
=
"mount/secret/"
expected
=
(
"mount"
,
"secret/"
)
self
.
assertEqual
(
expected
,
split_path
(
full_path
))
def
test_split_path_empty_string
(
self
):
full_path
=
""
expected
=
(
""
,
""
)
self
.
assertEqual
(
expected
,
split_path
(
full_path
))
if
__name__
==
"__main__"
:
unittest
.
main
()
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Mon, Nov 17, 15:51 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3174047
Default Alt Text
test_utils.py (1 KB)
Attached To
Mode
rRPRT Nasqueron internal reports
Attached
Detach File
Event Timeline
Log In to Comment