Skip to content

Commit

Permalink
Merge pull request #369 from mhjacks/test_linter
Browse files Browse the repository at this point in the history
Fix lint issue on main
  • Loading branch information
mhjacks committed May 22, 2024
2 parents 6e11cb2 + c7a01a6 commit 82155aa
Showing 1 changed file with 34 additions and 40 deletions.
74 changes: 34 additions & 40 deletions tests/unit/plugins/module_utils/test_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,50 +179,44 @@ def test_duplicate(self, tmp_path):

class TestAttachmentAreChanged:
def test_unchanged(self):
assert (
attachment.are_changed(
[
{"hash": "hash", "file_name": "attachment_name.txt"},
{"hash": "hash", "file_name": "another_file_name.txt"},
],
{
"attachment_name.txt": {
"path": "some/path/file_name.txt",
"type": "text/markdown",
"hash": "hash",
},
"another_file_name.txt": {
"path": "some/path/another_file_name.txt",
"type": "text/plain",
"hash": "hash",
},
assert attachment.are_changed(
[
{"hash": "hash", "file_name": "attachment_name.txt"},
{"hash": "hash", "file_name": "another_file_name.txt"},
],
{
"attachment_name.txt": {
"path": "some/path/file_name.txt",
"type": "text/markdown",
"hash": "hash",
},
)
== [False, False]
)
"another_file_name.txt": {
"path": "some/path/another_file_name.txt",
"type": "text/plain",
"hash": "hash",
},
},
) == [False, False]

def test_changed(self):
assert (
attachment.are_changed(
[
{"hash": "oldhash", "file_name": "attachment_name.txt"},
{"hash": "oldhash", "file_name": "another_file_name.txt"},
],
{
"attachment_name.txt": {
"path": "some/path/file_name.txt",
"type": "text/markdown",
"hash": "hash",
},
"another_file_name.txt": {
"path": "some/path/another_file_name.txt",
"type": "text/plain",
"hash": "hash",
},
assert attachment.are_changed(
[
{"hash": "oldhash", "file_name": "attachment_name.txt"},
{"hash": "oldhash", "file_name": "another_file_name.txt"},
],
{
"attachment_name.txt": {
"path": "some/path/file_name.txt",
"type": "text/markdown",
"hash": "hash",
},
)
== [True, True]
)
"another_file_name.txt": {
"path": "some/path/another_file_name.txt",
"type": "text/plain",
"hash": "hash",
},
},
) == [True, True]


class TestAttachmentListRecords:
Expand Down

0 comments on commit 82155aa

Please sign in to comment.