Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

core_test_utils.py 476 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  1. import asyncio
  2. import os.path
  3. def async_test_runner(async_io_co_routine):
  4. """
  5. Used as a decorator to run asynchronous testing
  6. :param async_io_co_routine:
  7. :return: Wrapped function
  8. """
  9. def wrapper(*args, **kwargs):
  10. loop = asyncio.new_event_loop()
  11. return loop.run_until_complete(async_io_co_routine(*args, **kwargs))
  12. return wrapper
  13. def is_data_available(sub_dir: str = ""):
  14. return os.path.exists(f"/data/{sub_dir}")
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...