@mock.patch.object(os, 'access', autospec=True)
def test__check_dir_writable_not_writable(self, mock_access):
    mock_access.return_value = False
    self.assertRaises(exception.DirectoryNotWritable, utils._check_dir_writable, '/fake/path')
    mock_access.assert_called_once_with('/fake/path', os.W_OK)
@mock.patch.object(os, 'access', autospec=True)
def test__check_dir_writable_not_writable(self, mock_access):
    mock_access.return_value = False
    self.assertRaises(exception.DirectoryNotWritable, utils._check_dir_writable, '/fake/path')
    mock_access.assert_called_once_with('/fake/path', os.W_OK)