Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1284afb
commit a83e647
Showing
8 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"a": 1, "b": 2, "c": 3, "x": 7, "y": 8, "z": 9} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pathlib | ||
import unittest | ||
|
||
from benedict import benedict | ||
|
||
|
||
class github_issue_0144_test_case(unittest.TestCase): | ||
""" | ||
This class describes a github issue 0144 test case. | ||
https://github.com/fabiocaccamo/python-benedict/issues/144 | ||
To run this specific test: | ||
- Run python -m unittest tests.github.test_issue_0144 | ||
""" | ||
|
||
def test_init_with_pathlib_path_object_and_valid_path(self): | ||
# print(pathlib.Path("./test_issue_0144.json")) | ||
d = benedict(pathlib.Path("tests/github/test_issue_0144.json"), format="json") | ||
self.assertEqual(d, {"a": 1, "b": 2, "c": 3, "x": 7, "y": 8, "z": 9}) | ||
|
||
def test_init_with_pathlib_path_object_and_invalid_path(self): | ||
with self.assertRaises(ValueError): | ||
benedict( | ||
pathlib.Path("tests/github/test_issue_0144_invalid.json"), format="json" | ||
) |