Skip to content

Commit 91013e1

Browse files
committed
snake_case assertStrContentEqual to assert_str_content_equal
1 parent 8a0e76e commit 91013e1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pymatgen/analysis/tests/test_graphs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ def test_str(self):
288288
# don't care about testing Py 2.7 unicode support,
289289
# change Å to A
290290
self.mos2_sg.graph.graph["edge_weight_units"] = "A"
291-
self.assertStrContentEqual(str(self.square_sg), square_sg_str_ref)
292-
self.assertStrContentEqual(str(self.mos2_sg), mos2_sg_str_ref)
291+
self.assert_str_content_equal(str(self.square_sg), square_sg_str_ref)
292+
self.assert_str_content_equal(str(self.mos2_sg), mos2_sg_str_ref)
293293

294294
def test_mul(self):
295295
square_sg_mul = self.square_sg * (2, 1, 1)
@@ -323,7 +323,7 @@ def test_mul(self):
323323
square_sg_mul_ref_str = "\n".join(square_sg_mul_ref_str.splitlines()[11:])
324324
square_sg_mul_actual_str = "\n".join(square_sg_mul_actual_str.splitlines()[11:])
325325

326-
self.assertStrContentEqual(square_sg_mul_actual_str, square_sg_mul_ref_str)
326+
self.assert_str_content_equal(square_sg_mul_actual_str, square_sg_mul_ref_str)
327327

328328
# test sequential multiplication
329329
sq_sg_1 = self.square_sg * (2, 2, 1)

pymatgen/symmetry/tests/test_maggroups.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_symmetry_ops(self):
109109
-x+5/4, y+1/2, -z+3/4, -1
110110
-x+1/2, y+3/4, z+1/4, -1
111111
x+3/4, -y+1/2, z+1/4, -1"""
112-
self.assertStrContentEqual(msg_1_symmops, msg_1_symmops_ref)
112+
self.assert_str_content_equal(msg_1_symmops, msg_1_symmops_ref)
113113

114114
msg_2_symmops = "\n".join(map(str, self.msg_2.symmetry_ops))
115115
msg_2_symmops_ref = """x, y, z, +1
@@ -120,7 +120,7 @@ def test_symmetry_ops(self):
120120
-x+1/2, -y, z+1/2, -1
121121
-x+1/2, y+1/2, z+1/2, -1
122122
x+1/2, y, -z+1/2, -1"""
123-
self.assertStrContentEqual(msg_2_symmops, msg_2_symmops_ref)
123+
self.assert_str_content_equal(msg_2_symmops, msg_2_symmops_ref)
124124

125125
msg_3_symmops = "\n".join(map(str, self.msg_3.symmetry_ops))
126126
msg_3_symmops_ref = """x, y, z, +1
@@ -200,8 +200,8 @@ def test_str(self):
200200
2b (0,y,1/2;mx,0,mz) (0,y+1,-1/2;-mx,0,-mz)
201201
2a (0,y,0;mx,0,mz) (0,y+1,0;-mx,0,-mz)"""
202202

203-
self.assertStrContentEqual(str(msg), ref_string)
204-
self.assertStrContentEqual(msg.data_str(), ref_string_all)
203+
self.assert_str_content_equal(str(msg), ref_string)
204+
self.assert_str_content_equal(msg.data_str(), ref_string_all)
205205

206206

207207
if __name__ == "__main__":

pymatgen/util/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def assert_all_close(actual, desired, decimal=7, err_msg="", verbose=True):
6666
return assert_allclose(actual, desired, atol=10**-decimal, err_msg=err_msg, verbose=verbose)
6767

6868
@staticmethod
69-
def assertStrContentEqual(actual, desired, err_msg="", verbose=True):
69+
def assert_str_content_equal(actual, desired, err_msg="", verbose=True):
7070
"""
7171
Tests if two strings are equal, ignoring things like trailing spaces, etc.
7272
"""

0 commit comments

Comments
 (0)