Skip to content

Commit cff5b2d

Browse files
committed
fix: broken tests
1 parent e63ce20 commit cff5b2d

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

src/pwncore/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from contextlib import asynccontextmanager
22

33
import aiodocker
4-
from aiodocker import docker
54
from fastapi import FastAPI
65
from fastapi.middleware.cors import CORSMiddleware
76
from tortoise import Tortoise

src/pwncore/containerASD.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import asyncio
1+
# import asyncio
22

33
import aiodocker
44

5-
from pwncore.config import config
5+
# from pwncore.config import config
66

77
docker_client: aiodocker.Docker = None # type: ignore[assignment]
88

src/pwncore/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import typing
77

88
import tortoise
9-
from tortoise.contrib.pydantic.creator import pydantic_model_creator
109

1110
from pwncore.models.container import Container, Ports
1211
from pwncore.models.ctf import (

src/pwncore/models/ctf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from math import tanh
4-
from typing import Any
54

65
from tortoise.models import Model
76
from tortoise import fields
@@ -31,7 +30,7 @@ class BaseProblem(Model):
3130

3231
class Problem(BaseProblem):
3332
image_name = fields.TextField()
34-
33+
3534
# commenting it for now, may be used later
3635
# image_config: fields.Field[dict[str, Any]] = fields.JSONField(
3736
# null=True

src/pwncore/routes/ctf/start.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ async def start_docker_container(ctf_id: int, response: Response, jwt: RequireJw
2626
"22/tcp": [{}] # Let docker randomly assign ports
2727
}
2828
}
29-
29+
3030
Notes:
31-
- image_config has been commented out in the Problem model for now.
32-
- It's not necessary to pass the ports to expose in image_config,
31+
- image_config has been commented out in the Problem model for now.
32+
- It's not necessary to pass the ports to expose in image_config,
3333
Docker will automatically map a random port to the container's exposed port.
3434
"""
3535
async with in_transaction():

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ python =
1717
[testenv]
1818
description = run api tests
1919
deps =
20-
fastapi
21-
httpx
22-
pytest
23-
passlib
20+
fastapi==0.104.1
21+
httpx==0.25.2
22+
pytest==7.4.4
23+
passlib==1.7.4
2424
commands = pytest
2525

2626
[testenv:type]

0 commit comments

Comments
 (0)