def test_shift_path_verbose(self, mock_lstat, mock_print, mock_lchown): mock_lstat.return_value = FakeStat(0, 0) idmapshift.shift_path('/test/path', self.uid_maps, self.gid_maps, main.NOBODY_ID, dict(), dict(), verbose=True) mock_lstat.assert_has_calls([mock.call('/test/path')]) mock_print_call = mock.call('/test/path', 0, 0, 10000, 10000) mock_print.assert_has_calls([mock_print_call]) mock_lchown.assert_has_calls([mock.call('/test/path', 10000, 10000)])
def test_shift_path_dry_run(self, mock_lstat, mock_lchown): mock_lstat.return_value = FakeStat(0, 0) idmapshift.shift_path('/test/path', self.uid_maps, self.gid_maps, main.NOBODY_ID, dict(), dict(), dry_run=True) mock_lstat.assert_has_calls([mock.call('/test/path')]) self.assertEqual(0, len(mock_lchown.mock_calls))