ready for release
This commit is contained in:
31
tests/test_app.py
Normal file
31
tests/test_app.py
Normal file
@@ -0,0 +1,31 @@
|
||||
#import os
|
||||
#os.chdir(os.path.dirname(__file__))
|
||||
|
||||
from config_manager import ConfigManager
|
||||
import logging
|
||||
import asyncio
|
||||
from typing import Optional
|
||||
|
||||
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
class MyApp(ConfigManager):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.iter = 0
|
||||
|
||||
def execute(self) -> None:
|
||||
logger.info(f"current iteration {self.iter}")
|
||||
self.iter += 1
|
||||
|
||||
async def main():
|
||||
app = MyApp("config.yaml")
|
||||
app.start()
|
||||
logger.info("App started")
|
||||
await asyncio.sleep(20)
|
||||
await app.stop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
|
||||
Reference in New Issue
Block a user