A mirror of dcurooms found at https://github.com/theycallmemac/dcurooms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_now.py 473 B

12345678910111213141516171819
  1. import unittest
  2. import sys
  3. import datetime
  4. sys.path.append('.')
  5. from scripts.utils import get_current_time
  6. class RequiredTestCase(unittest.TestCase):
  7. def test_time(self):
  8. now = get_current_time(datetime.datetime.now())
  9. hr = int(now[2])
  10. mn = int(now[3])
  11. hr_d = datetime.datetime.now().hour
  12. mn_d = datetime.datetime.now().minute
  13. self.assertTrue(hr == hr_d and mn == mn_d)
  14. if __name__ == '__main__':
  15. unittest.main()