'''Created Jul 7, 2021 Levi'''

import unittest
from revisal.rvs import ReviSal, get_db_folder
from revisal import consts


class Test(unittest.TestCase):

    revisal = ReviSal()

    def test_init(self):
        # self.assertIsInstance(revisal.ver, str)
        print(self.revisal._conf_file)
        print(self.revisal._us_profile)
        print(self.revisal.ver)

    def test_accounts(self):
        accounts = self.revisal.accounts()
        print(len(accounts))
        # for ind, account in enumerate(accounts):
        #     print(account)
        select = int(input(f'type number from 0 to {len(accounts)} '))
        print(accounts[select].name)

    def test_bulk_create(self):
        self.revisal.bulk_create()

    def test_employer(self):
        e = self.revisal.get_employer('ALPA SOLUTION')
        print(e.name)

    def test_dbfolder(self):
        print(self.revisal._db_folder)

    def test_connect(self):
        print(self.revisal.connect('FLAUR CONSTRUCT'))

    def test_create_df(self):
        print(self.revisal.create_df('audit'))

    def test_emp_details(self):
        print(self.revisal.emp_details())

    def test_make_xlsm(self):
        self.revisal.connect()
        self.revisal.emp_details()
        self.revisal.create_df('simple')
        self.revisal.make_xlsm()

    def test_SAL_MIN(self):
        print(consts.SAL_MIN)

    def test_get_db_folder(self):
        print(get_db_folder())


if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()
