# Path: tests/test_utils.py
# def load_module(name, path):


import argparse
import os
import shutil
import sys
import tempfile
import unittest
from tests import test_utils
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Unit tests demo scikit-learn model."""



class TestModel(unittest.TestCase):
    """Tests demo model."""

    @classmethod
    def setUpClass(cls):
        super(TestModel, cls).setUpClass()
        cls.test_dir = tempfile.mkdtemp()
        cls.demo_dir = os.path.join(cls.test_dir, 'demo')
        shutil.copytree('examples/sklearn', cls.demo_dir)

        # TODO(humichael) We can't import the model using __import__ because
        # several other examples are also adding their demo dirs to sys.path.
        # It's very likely the model module that is imported is not the one from
        # this test. All examples currently use the same census_preprocess.
        # These tests will break if any example uses a different preprocessing
        # script.
        # We should just mock this.
        sys.path.append(cls.demo_dir)
        sklearn_model = test_utils.load_module(
            'sklearn_model', os.path.join(
                cls.demo_dir, 'model', 'sklearn_model.py'))

# Path: tests/test_utils.py
# def load_module(name, path):


# Path: tests/unit/examples/sklearn/test_sklearn_model.py
import argparse
import os
import shutil
import sys
import tempfile
import unittest
from tests import test_utils

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Unit tests demo scikit-learn model."""



class TestModel(unittest.TestCase):
    """Tests demo model."""

    @classmethod
    def setUpClass(cls):
        super(TestModel, cls).setUpClass()
        cls.test_dir = tempfile.mkdtemp()
        cls.demo_dir = os.path.join(cls.test_dir, 'demo')
        shutil.copytree('examples/sklearn', cls.demo_dir)

        # TODO(humichael) We can't import the model using __import__ because
        # several other examples are also adding their demo dirs to sys.path.
        # It's very likely the model module that is imported is not the one from
        # this test. All examples currently use the same census_preprocess.
        # These tests will break if any example uses a different preprocessing
        # script.
        # We should just mock this.
        sys.path.append(cls.demo_dir)
        sklearn_model = test_utils.load_module(
            'sklearn_model', os.path.join(
                cls.demo_dir, 'model', 'sklearn_model.py'))

        sklearn_preprocess = test_utils.load_module(