11 lines
288 B
Python
11 lines
288 B
Python
import pytest
|
|
from app.core import models
|
|
|
|
# Example test
|
|
@pytest.mark.parametrize("cidr, expected", [
|
|
('192.168.1.0/24', 256),
|
|
('10.0.0.0/8', 16777216),
|
|
])
|
|
def test_subnet_cidr_parsing(cidr, expected):
|
|
subnet = models.Subnet(cidr=cidr)
|
|
assert subnet.used_ips == expected
|