Skip to content

Commit

Permalink
Run black on test files.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Dec 1, 2021
1 parent 54667b4 commit 053579f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
32 changes: 26 additions & 6 deletions tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,29 @@ def test_unsafe_hash(self):
b_dict = {"first": GMC(3, 3.0, "three"), "second": GMC(4, 4.0, "four")}
c_list_dict_list = [
{
"list1": [GMC(5, 5.0, "five"), GMC(6, 6.0, "six"), GMC(7, 7.0, "seven"),],
"list1": [
GMC(5, 5.0, "five"),
GMC(6, 6.0, "six"),
GMC(7, 7.0, "seven"),
],
"list2": [GMC(8, 8.0, "eight")],
},
{
"list3": [GMC(9, 9.0, "nine"), GMC(10, 10.0, "ten"), GMC(11, 11.0, "eleven"), GMC(12, 12.0, "twelve"),],
"list3": [
GMC(9, 9.0, "nine"),
GMC(10, 10.0, "ten"),
GMC(11, 11.0, "eleven"),
GMC(12, 12.0, "twelve"),
],
"list4": [GMC(13, 13.0, "thirteen"), GMC(14, 14.0, "fourteen")],
"list5": [GMC(15, 15.0, "fifteen")],
},
]
obj = GoodNestedMSONClass(a_list=a_list, b_dict=b_dict, c_list_dict_list=c_list_dict_list)

self.assertEqual(
a_list[0].unsafe_hash().hexdigest(), "ea44de0e2ef627be582282c02c48e94de0d58ec6",
a_list[0].unsafe_hash().hexdigest(),
"ea44de0e2ef627be582282c02c48e94de0d58ec6",
)
self.assertEqual(obj.unsafe_hash().hexdigest(), "44204c8da394e878f7562c9aa2e37c2177f28b81")

Expand All @@ -176,11 +186,20 @@ def test_nested_to_from_dict(self):
b_dict = {"first": GMC(3, 3.0, "three"), "second": GMC(4, 4.0, "four")}
c_list_dict_list = [
{
"list1": [GMC(5, 5.0, "five"), GMC(6, 6.0, "six"), GMC(7, 7.0, "seven"),],
"list1": [
GMC(5, 5.0, "five"),
GMC(6, 6.0, "six"),
GMC(7, 7.0, "seven"),
],
"list2": [GMC(8, 8.0, "eight")],
},
{
"list3": [GMC(9, 9.0, "nine"), GMC(10, 10.0, "ten"), GMC(11, 11.0, "eleven"), GMC(12, 12.0, "twelve"),],
"list3": [
GMC(9, 9.0, "nine"),
GMC(10, 10.0, "ten"),
GMC(11, 11.0, "eleven"),
GMC(12, 12.0, "twelve"),
],
"list4": [GMC(13, 13.0, "thirteen"), GMC(14, 14.0, "fourteen")],
"list5": [GMC(15, 15.0, "fifteen")],
},
Expand Down Expand Up @@ -501,7 +520,8 @@ def test_redirect(self):
def test_redirect_settings_file(self):
data = _load_redirect(os.path.join(test_dir, "test_settings.yaml"))
self.assertEqual(
data, {"old_module": {"old_class": {"@class": "new_class", "@module": "new_module"}}},
data,
{"old_module": {"old_class": {"@class": "new_class", "@module": "new_module"}}},
)

def test_pydantic_integrations(self):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def test_dumpfn_loadfn(self):
with self.assertRaises(TypeError):
loadfn("monte_test.txt", fmt="garbage")



@unittest.skipIf(msgpack is None, "msgpack-python not installed.")
def test_mpk(self):
d = {"hello": "world"}
Expand Down

0 comments on commit 053579f

Please sign in to comment.