# Path: py_stringsimjoin/utils/generic_helper.py
# def get_num_processes_to_launch(n_jobs):        
#     # determine number of processes to launch parallely
#     num_procs = n_jobs
#     if n_jobs < 0:
#         num_cpus = multiprocessing.cpu_count()
#         num_procs = num_cpus + 1 + n_jobs
#     return max(num_procs, 1)


import multiprocessing
import unittest
import pandas as pd
from nose.tools import assert_equal, assert_list_equal, raises
from py_stringsimjoin.utils.generic_helper import get_num_processes_to_launch




class GetNumProcessesToLaunchTestCases(unittest.TestCase):
    def setUp(self):
        self.cpu_count = multiprocessing.cpu_count()

    def test_n_jobs_minus_1(self):

# Path: py_stringsimjoin/utils/generic_helper.py
# def get_num_processes_to_launch(n_jobs):        
#     # determine number of processes to launch parallely
#     num_procs = n_jobs
#     if n_jobs < 0:
#         num_cpus = multiprocessing.cpu_count()
#         num_procs = num_cpus + 1 + n_jobs
#     return max(num_procs, 1)


# Path: py_stringsimjoin/tests/test_helper_functions.py
import multiprocessing
import unittest
import pandas as pd
from nose.tools import assert_equal, assert_list_equal, raises
from py_stringsimjoin.utils.generic_helper import get_num_processes_to_launch





class GetNumProcessesToLaunchTestCases(unittest.TestCase):
    def setUp(self):
        self.cpu_count = multiprocessing.cpu_count()

    def test_n_jobs_minus_1(self):

        assert_equal(get_num_processes_to_launch(-1), self.cpu_count)