-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): update tests samples, fix copy_file method
- Loading branch information
Showing
46 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
|
||
def get_version(): | ||
print("2.14.1") | ||
print("2.14.4") | ||
|
||
|
||
# entry point | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "2.14.4" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
This script simulates the behavior of an application and return its current version. | ||
Support script for Windows systems | ||
""" | ||
|
||
import sys | ||
import uvicorn | ||
|
||
|
||
def get_version(): | ||
print("2.15.2") | ||
|
||
|
||
# entry point | ||
if __name__ == "__main__": | ||
if "--version" in sys.argv or "-v" in sys.argv: | ||
get_version() | ||
elif len(sys.argv) == 1: | ||
uvicorn.run("server:app", host="127.0.0.1", port=8080, log_level="info") | ||
else: | ||
print("Usage: AntaresWebServer [-v | --version]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
""" | ||
This script simulates the behavior of an application and return its current version. | ||
Support script for Windows systems | ||
""" | ||
|
||
import asyncio | ||
import contextlib | ||
import os | ||
import signal | ||
|
||
from fastapi import FastAPI | ||
|
||
TIMEOUT = 10 # duration in seconds of server execution | ||
|
||
|
||
async def timer(duration: int): | ||
await asyncio.sleep(duration) | ||
os.kill(os.getpid(), signal.SIGTERM) | ||
|
||
|
||
@contextlib.asynccontextmanager | ||
async def lifespan(app: FastAPI): | ||
# noinspection PyAsyncCall | ||
asyncio.create_task(timer(TIMEOUT)) # launch server timeout | ||
yield | ||
|
||
|
||
app = FastAPI(lifespan=lifespan) | ||
|
||
|
||
@app.get("/") | ||
def index(): | ||
return {"response": "Successfully running"} |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.