# 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
)


def test_lower_case_for_user(monkeypatch):
    main_args = ['--host',
                 'http://localhost:53646/api',
                 '--user', 'DataRobot@datarobot.com',
                 '56dd9570018e213242dfa93c',
                 '56dd9570018e213242dfa93d',
                 'tests/fixtures/temperatura_predict.csv',
                 '--n_samples',
                 '10',
                 '--n_concurrent', '1']

    monkeypatch.setattr('datarobot_batch_scoring.main.UI', mock.Mock(spec=UI))

    with mock.patch(
            'datarobot_batch_scoring.main'
            '.run_batch_predictions') as mock_method:

# 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
)



def test_lower_case_for_user(monkeypatch):
    main_args = ['--host',
                 'http://localhost:53646/api',
                 '--user', 'DataRobot@datarobot.com',
                 '56dd9570018e213242dfa93c',
                 '56dd9570018e213242dfa93d',
                 'tests/fixtures/temperatura_predict.csv',
                 '--n_samples',
                 '10',
                 '--n_concurrent', '1']

    monkeypatch.setattr('datarobot_batch_scoring.main.UI', mock.Mock(spec=UI))

    with mock.patch(
            'datarobot_batch_scoring.main'
            '.run_batch_predictions') as mock_method:

        main(argv=main_args)