def test_del_rw(self): with mock.patch('os.chmod') as mock_chmod,\ mock.patch('os.remove') as mock_remove: del_rw(None, None, None) self.assertTrue(mock_chmod.called) self.assertTrue(mock_remove.called)
def test_del_rw(self, mocker): mock_chmod = mocker.patch("os.chmod") mock_remove = mocker.patch("os.remove") del_rw(None, None, None) assert mock_chmod.called is True assert mock_remove.called is True
def test_del_rw(self): with mock.patch('os.chmod') as mock_chmod,\ mock.patch('os.remove') as mock_remove: del_rw(None, None, None) self.assertTrue(mock_chmod.called) self.assertTrue(mock_remove.called)