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.

26 lines
740 B

  1. from body_create import rrule_former,create_body
  2. def test_rrule():
  3. #test
  4. now = datetime.datetime.now()
  5. from munch import Munch
  6. test_obj = Munch(
  7. days=[1,3,5],
  8. time_range=[
  9. now.time(),
  10. (now+datetime.timedelta(seconds=50*60)).time()
  11. ],
  12. date_range=[
  13. now.date(),
  14. (now+datetime.timedelta(days=20)).date()
  15. ],
  16. )
  17. test_result = rrule_former(test_obj)
  18. return locals()
  19. def testclass_obj2body():
  20. with open('classes.pkl','rb') as file:
  21. classes = pickle.load(file)
  22. test_result = list(filter(bool,map(create_body,classes)))
  23. return test_result
  24. if __name__ == "__main__":
  25. json_dump(testclass_obj2body())