Created
May 12, 2019 17:34
Revisions
-
dishbreak created this gist
May 12, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import os import mock class AnyStringEndingWith(object): def __init__(self, suffix): self.suffix = suffix def __repr__(self): return "<a string ending with '%s'>" % self.suffix def __eq__(self, other): return other.endswith(self.suffix) @mock.patch("os.path") def test_matcher(mock_path): mock_path.isfile(os.path.join("not", "a", "real", "path")) mock_path.isfile.assert_called_with(AnyStringEndingWith("path"))