fix(resources): add expires_at sentinel comment; move pytest import to module level
This commit is contained in:
parent
0888f0f16b
commit
b774afb6b0
2 changed files with 2 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ class VRAMLease:
|
||||||
mb_granted: int
|
mb_granted: int
|
||||||
holder_service: str
|
holder_service: str
|
||||||
priority: int
|
priority: int
|
||||||
expires_at: float
|
expires_at: float # unix timestamp; 0.0 = no expiry
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import time
|
import time
|
||||||
|
import pytest
|
||||||
from circuitforge_core.resources.models import VRAMLease, GpuInfo, NodeInfo
|
from circuitforge_core.resources.models import VRAMLease, GpuInfo, NodeInfo
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -27,7 +28,6 @@ def test_vram_lease_create_no_ttl_has_zero_expiry():
|
||||||
def test_vram_lease_is_immutable():
|
def test_vram_lease_is_immutable():
|
||||||
lease = VRAMLease.create(gpu_id=0, node_id="heimdall", mb=1024,
|
lease = VRAMLease.create(gpu_id=0, node_id="heimdall", mb=1024,
|
||||||
service="snipe", priority=2)
|
service="snipe", priority=2)
|
||||||
import pytest
|
|
||||||
with pytest.raises((AttributeError, TypeError)):
|
with pytest.raises((AttributeError, TypeError)):
|
||||||
lease.mb_granted = 999 # type: ignore
|
lease.mb_granted = 999 # type: ignore
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue