<commit_before># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import open

import os
import glob
import shutil
import os.path as op
from tempfile import mkstemp, mkdtemp
from subprocess import Popen

from nose.tools import assert_raises
import nipype
from nipype.testing import assert_equal, assert_true, assert_false, skipif
import nipype.interfaces.io as nio
from nipype.interfaces.base import Undefined

# Check for boto
noboto = False
try:
    import boto
    from boto.s3.connection import S3Connection, OrdinaryCallingFormat
except:
    noboto = True

# Check for boto3
noboto3 = False
try:
    import boto3
    from botocore.utils import fix_s3_host
except:
    noboto3 = True

# Check for fakes3
import subprocess
try:
    ret_code = subprocess.check_call(['which', 'fakes3'], stdout=open(os.devnull, 'wb'))
    if ret_code == 0:
        fakes3 = True
    else:
        fakes3 = False
except:
    fakes3 = False

def test_datagrabber():
    dg = nio.DataGrabber()
    yield assert_equal, dg.inputs.template, Undefined
    yield assert_equal, dg.inputs.base_directory, Undefined
    yield assert_equal, dg.inputs.template_args, {'outfiles': []}

<commit_msg>Made exceptions more explicit<commit_after># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function
from builtins import zip
from builtins import range
from builtins import open

import os
import glob
import shutil
import os.path as op
from tempfile import mkstemp, mkdtemp
from subprocess import Popen

from nose.tools import assert_raises
import nipype
from nipype.testing import assert_equal, assert_true, assert_false, skipif
import nipype.interfaces.io as nio
from nipype.interfaces.base import Undefined

# Check for boto
noboto = False
try:
    import boto
    from boto.s3.connection import S3Connection, OrdinaryCallingFormat
except ImportError:
    noboto = True

# Check for boto3
noboto3 = False
try:
    import boto3
    from botocore.utils import fix_s3_host
except ImportError:
    noboto3 = True

# Check for fakes3
import subprocess
try:
    ret_code = subprocess.check_call(['which', 'fakes3'], stdout=open(os.devnull, 'wb'))
    if ret_code == 0:
        fakes3 = True
    else:
        fakes3 = False
except subprocess.CalledProcessError:
    fakes3 = False

def test_datagrabber():
    dg = nio.DataGrabber()
    yield assert_equal, dg.inputs.template, Undefined
    yield assert_equal, dg.inputs.base_directory, Undefined
    yield assert_equal, dg.inputs.template_args, {'outfiles': []}


{'fraction_non_alphanumeric': 0.07840991976659373, 'fraction_numerical': 0.012399708242159009, 'mean_word_length': 4.1367041198501875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3849031', 'n_tokens_mistral': 907, 'n_tokens_neox': 899, 'n_words': 286}