def setUp(self): if not os.path.isfile(self.config_file): raise Exception( "HRauth configuration file not found in: {}".format( self.config_file)) self.auth = HRauth(config_file=self.config_file) self.get = HRget(self.auth)
def __init__(self, *args, **kwargs): super(test_HRpresence_functionalities, self).__init__(*args, **kwargs) if not os.path.isfile(self.config_file): raise Exception( "HRauth configuration file not found in: {}".format( self.config_file)) self.auth = HRauth(config_file=self.config_file) self.get = HRget(self.auth) self.presence = HRpresence(self.get.presence()) self.file_name = 'test_HRpresence_file'
def setUp(self): if not os.path.isfile(self.config_file): raise Exception( "HRauth configuration file not found in: {}".format( self.config_file)) self.auth = HRauth(config_file=self.config_file) self.json = HRget(self.auth).get(day=datetime.datetime.today().day) self.day = HRday(self.json)
class test_HRget_functionalities(unittest.TestCase): config_file = HRauth_default['config_file'] def setUp(self): if not os.path.isfile(self.config_file): raise Exception( "HRauth configuration file not found in: {}".format( self.config_file)) self.auth = HRauth(config_file=self.config_file) self.get = HRget(self.auth) self.today = datetime.datetime.today() def tearDown(self): pass def test_HRget_get_default(self): default = self.get.get() def test_HRget_get_error_day(self): self.assertRaises(Exception, self.get.get, day=33) def test_HRget_get_error_day2(self): self.assertRaises(Exception, self.get.get, day=-1) def test_HRget_get_error_month(self): self.assertRaises(Exception, self.get.get, month=13) def test_HRget_get_date(self): date = self.get.get(self.today.year, self.today.month, self.today.day) def test_HRget_get_day(self): day = self.get.get(day=self.today.day) def test_HRget_get_month(self): month = self.get.get(month=self.today.month) def test_HRget_get_year(self): year = self.get.get(year=self.today.year)
class test_HRpresence_inititalization(unittest.TestCase): config_file = HRauth_default['config_file'] def setUp(self): if not os.path.isfile(self.config_file): raise Exception( "HRauth configuration file not found in: {}".format( self.config_file)) self.auth = HRauth(config_file=self.config_file) self.get = HRget(self.auth) def tearDown(self): pass def test_HRpresence_initialization(self): d = HRpresence(self.get.presence())
class test_HRday_inititalization(unittest.TestCase): config_file = HRauth_default['config_file'] def setUp(self): if not os.path.isfile(self.config_file): raise Exception( "HRauth configuration file not found in: {}".format( self.config_file)) self.auth = HRauth(config_file=self.config_file) self.get = HRget(self.auth) self.today = datetime.datetime.today() def tearDown(self): pass def test_HRday_initialization(self): json = self.get.get(day=self.today.day) d = HRday(json)
class test_HRpresence_functionalities(unittest.TestCase): config_file = HRauth_default['config_file'] def __init__(self, *args, **kwargs): super(test_HRpresence_functionalities, self).__init__(*args, **kwargs) if not os.path.isfile(self.config_file): raise Exception( "HRauth configuration file not found in: {}".format( self.config_file)) self.auth = HRauth(config_file=self.config_file) self.get = HRget(self.auth) self.presence = HRpresence(self.get.presence()) self.file_name = 'test_HRpresence_file' def test_HRpresence_len(self): self.assertTrue(len(self.presence)) def test_HRpresence_dump_csv(self): self.presence.dump_csv(self.file_name) self.assertTrue(os.path.isfile(self.file_name)) os.remove(self.file_name) def test_HRpresence_dump_json(self): self.presence.dump_json(self.file_name) self.assertTrue(os.path.isfile(self.file_name)) os.remove(self.file_name) def test_HRpresence_read_csv(self): self.presence.dump_csv(self.file_name) self.assertTrue(os.path.isfile(self.file_name)) self.assertTrue(self.presence.read_csv(self.file_name)) os.remove(self.file_name) def test_HRpresence_read_json(self): self.presence.dump_json(self.file_name) self.assertTrue(os.path.isfile(self.file_name)) self.assertTrue(self.presence.read_json(self.file_name)) os.remove(self.file_name)
def test_HRget_initialization(self): HRget(self.auth)