forked from theskumar/python-dotenv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_utils.py
More file actions
19 lines (17 loc) · 747 Bytes
/
test_utils.py
File metadata and controls
19 lines (17 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from dotenv import get_cli_string as c
def test_to_cli_string():
assert c() == "dotenv"
assert c(path="/etc/.env") == "dotenv -f /etc/.env"
assert c(path="/etc/.env", action="list") == "dotenv -f /etc/.env list"
assert c(action="list") == "dotenv list"
assert c(action="get", key="DEBUG") == "dotenv get DEBUG"
assert c(action="set", key="DEBUG", value="True") == "dotenv set DEBUG True"
assert (
c(action="set", key="SECRET", value="=@asdfasf")
== "dotenv set SECRET =@asdfasf"
)
assert c(action="set", key="SECRET", value="a b") == 'dotenv set SECRET "a b"'
assert (
c(action="set", key="SECRET", value="a b", quote="always")
== 'dotenv -q always set SECRET "a b"'
)