self._copy_tree([src1], dst, uid=0, gid=0)
assert len(_chown.mock_calls) >= 2
for c in _chown.mock_calls:
- assert c.args[1:] == (0, 0)
+ assert c == mock.call(mock.ANY, 0, 0)
assert (dst / "foo.txt").exists()
self._copy_files([file1], dst, uid=0, gid=0)
assert len(_chown.mock_calls) >= 1
for c in _chown.mock_calls:
- assert c.args[1:] == (0, 0)
+ assert c == mock.call(mock.ANY, 0, 0)
assert (dst / "f1.txt").exists()
self._move_files([file1], dst, uid=0, gid=0)
assert len(_chown.mock_calls) >= 1
for c in _chown.mock_calls:
- assert c.args[1:] == (0, 0)
+ assert c == mock.call(mock.ANY, 0, 0)
assert dst.is_file()
assert not file1.exists()
_chown.return_value = None
_cephadm.recursive_chown(str(d1), uid=500, gid=500)
assert len(_chown.mock_calls) == 3
- assert _chown.mock_calls[0].args == (str(d1), 500, 500)
- assert _chown.mock_calls[1].args == (str(d2), 500, 500)
- assert _chown.mock_calls[2].args == (str(f1), 500, 500)
+ assert _chown.mock_calls[0] == mock.call(str(d1), 500, 500)
+ assert _chown.mock_calls[1] == mock.call(str(d2), 500, 500)
+ assert _chown.mock_calls[2] == mock.call(str(f1), 500, 500)
class TestFindExecutable: