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.

43 lines
1.4 KiB

  1. import unittest
  2. import sys
  3. import datetime
  4. from scripts import utils
  5. from scripts import now
  6. from test_required import required
  7. class AvailableNowIntegrationTestCase(unittest.TestCase):
  8. def setUp(self):
  9. return required()
  10. def test_lab(self):
  11. parser, (options, arguments), rooms, info = self.setUp()
  12. (options, args) = parser.parse_args(["-L"])
  13. lst = utils.get_lst(rooms[0], rooms[1], options)
  14. week, day, hour, minute = '2', '1', '14', '30'
  15. now_obj = now.Now(week, day, hour, minute)
  16. utils.check_args(week, day)
  17. now_obj.check_time(info[0])
  18. def test_room(self):
  19. parser, (options, arguments), rooms, info = self.setUp()
  20. (options, args) = parser.parse_args(["-C"])
  21. lst = utils.get_lst(rooms[0], rooms[1], options)
  22. week, day, hour, minute = '24', '2', '08', '00'
  23. now_obj = now.Now(week, day, hour, minute)
  24. utils.check_args(week, day)
  25. now_obj.check_time(info[0])
  26. def test_incorrect_input(self):
  27. parser, (options, arguments), rooms, info = self.setUp()
  28. (options, args) = parser.parse_args(["-L"])
  29. lst = utils.get_lst(rooms[0], rooms[1], options)
  30. week, day, hour, minute = '60', '7', '23', '57'
  31. now_obj = now.Now(week, day, hour, minute)
  32. try:
  33. utils.check_args(week, day)
  34. except SystemExit:
  35. pass
  36. if __name__ == '__main__':
  37. unittest.main()