Skip to content

Commit 53e9090

Browse files
committed
Add to_cli method (not implemented).
1 parent 69e60c9 commit 53e9090

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

benedict/dicts/io/io_dict.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def to_base64(self, subformat="json", encoding="utf-8", **kwargs):
195195
kwargs["encoding"] = encoding
196196
return self._encode(self.dict(), "base64", **kwargs)
197197

198+
def to_cli(self, **kwargs):
199+
raise NotImplementedError
200+
198201
def to_csv(self, key="values", columns=None, columns_row=True, **kwargs):
199202
"""
200203
Encode a list of dicts in the current dict instance in CSV format.

tests/dicts/io/test_io_dict_cli.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,18 @@ def test_from_cli_with_invalid_data(self):
4545
# constructor
4646
with self.assertRaises(ValueError):
4747
IODict(s, format="cli")
48+
49+
def test_to_cli(self):
50+
d = IODict(
51+
{
52+
"values": [
53+
{"x": "1"},
54+
{"x": "2"},
55+
{"x": "3"},
56+
{"x": "4"},
57+
{"x": "5"},
58+
],
59+
}
60+
)
61+
with self.assertRaises(NotImplementedError):
62+
_ = d.to_cli()

0 commit comments

Comments
 (0)