# Path: datarobot_batch_scoring/main.py
# VERSION_TEMPLATE = '%(prog)s {}'.format(__version__)
# DESCRIPTION = """
# Batch score DATASET by submitting prediction requests against HOST
# using PROJECT_ID and MODEL_ID (or IMPORT_ID in case of standalone predictions).
# 
# It optimizes prediction throughput by sending data in batches of 1.5mb.
# 
# Set N_CONCURRENT to match the number of cores in the prediction API endpoint.
# 
# The dataset has to be a single CSV file that can be gzipped (extension '.gz').
# The OUT will be a single CSV file but remember that records
# might be unordered.
# """
# EPILOG = """
# Example:
#   $ batch_scoring --host https://example.orm.datarobot.com \
#   --user="<username>" --password="<password>" 5545eb20b4912911244d4835 \
#   5545eb71b4912911244d4847 ~/Downloads/diabetes_test.csv
#   {deprecation_warning}
# """.format(deprecation_warning=DEPRECATION_WARNING)
# VALID_DELIMITERS = {';', ',', '|', '\t', ' ', '!', '  '}
# def parse_args(argv, standalone=False, deployment_aware=False):
# def parse_generic_options(parsed_args):
# def _main(argv, deployment_aware=False):
# def main(argv=sys.argv[1:]):
# def main_deployment_aware(argv=sys.argv[1:]):
# def main_standalone(argv=sys.argv[1:]):


import mock
import pytest
from datarobot_batch_scoring.main import (
    main, UI, main_standalone, parse_args, main_deployment_aware
)
            pred_threshold_name=None,
            pred_decision_name=None,
            timeout=None,
            ui=mock.ANY,
            fast_mode=False,
            auto_sample=True,
            dry_run=False,
            encoding='',
            skip_dialect=False,
            skip_row_id=False,
            output_delimiter=None,
            compression=False,
            field_size_limit=None,
            verify_ssl=True,
            max_prediction_explanations=0
        )


@pytest.mark.parametrize('ssl_argvs, verify_ssl_value', [
    ('', True),
    ('--no_verify_ssl', False),
    ('--ca_bundle /path/to/cert', '/path/to/cert'),
    ('--ca_bundle /path/to/cert --no_verify_ssl', False)
])
def test_verify_ssl_parameter(ssl_argvs, verify_ssl_value):
    argvs = (
        '--host http://localhost:53646/api '
        '56dd9570018e213242dfa93c 56dd9570018e213242dfa93d '
        'tests/fixtures/temperatura_predict.csv ' + ssl_argvs
    ).strip().split(' ')

# Path: datarobot_batch_scoring/main.py
# VERSION_TEMPLATE = '%(prog)s {}'.format(__version__)
# DESCRIPTION = """
# Batch score DATASET by submitting prediction requests against HOST
# using PROJECT_ID and MODEL_ID (or IMPORT_ID in case of standalone predictions).
# 
# It optimizes prediction throughput by sending data in batches of 1.5mb.
# 
# Set N_CONCURRENT to match the number of cores in the prediction API endpoint.
# 
# The dataset has to be a single CSV file that can be gzipped (extension '.gz').
# The OUT will be a single CSV file but remember that records
# might be unordered.
# """
# EPILOG = """
# Example:
#   $ batch_scoring --host https://example.orm.datarobot.com \
#   --user="<username>" --password="<password>" 5545eb20b4912911244d4835 \
#   5545eb71b4912911244d4847 ~/Downloads/diabetes_test.csv
#   {deprecation_warning}
# """.format(deprecation_warning=DEPRECATION_WARNING)
# VALID_DELIMITERS = {';', ',', '|', '\t', ' ', '!', '  '}
# def parse_args(argv, standalone=False, deployment_aware=False):
# def parse_generic_options(parsed_args):
# def _main(argv, deployment_aware=False):
# def main(argv=sys.argv[1:]):
# def main_deployment_aware(argv=sys.argv[1:]):
# def main_standalone(argv=sys.argv[1:]):


# Path: tests/test_main.py
import mock
import pytest
from datarobot_batch_scoring.main import (
    main, UI, main_standalone, parse_args, main_deployment_aware
)

            pred_threshold_name=None,
            pred_decision_name=None,
            timeout=None,
            ui=mock.ANY,
            fast_mode=False,
            auto_sample=True,
            dry_run=False,
            encoding='',
            skip_dialect=False,
            skip_row_id=False,
            output_delimiter=None,
            compression=False,
            field_size_limit=None,
            verify_ssl=True,
            max_prediction_explanations=0
        )


@pytest.mark.parametrize('ssl_argvs, verify_ssl_value', [
    ('', True),
    ('--no_verify_ssl', False),
    ('--ca_bundle /path/to/cert', '/path/to/cert'),
    ('--ca_bundle /path/to/cert --no_verify_ssl', False)
])
def test_verify_ssl_parameter(ssl_argvs, verify_ssl_value):
    argvs = (
        '--host http://localhost:53646/api '
        '56dd9570018e213242dfa93c 56dd9570018e213242dfa93d '
        'tests/fixtures/temperatura_predict.csv ' + ssl_argvs
    ).strip().split(' ')

    parsed_args = parse_args(argvs)