aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/fips/test_fips_mip.py
blob: 8748bf236da8328384cd22def9e69ec3666f8d5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from pathlib import Path

import pytest

import tests.data.fips.mip
from sec_certs.dataset import MIPDataset
from sec_certs.sample import MIPSnapshot


@pytest.fixture(scope="module")
def data_dir() -> Path:
    return Path(tests.data.fips.mip.__path__[0])


@pytest.fixture(scope="module")
def data_dump_path(data_dir) -> Path:
    return data_dir / "fips_mip_2021-02-19T06+01:00.html"


def test_mip_dataset_from_dumps(data_dir: Path):
    dset = MIPDataset.from_dumps(data_dir)
    assert dset
    assert len(dset) == 3


def test_mip_dataset_from_dataset_latest():
    assert MIPDataset.from_web_latest()


def test_mip_snapshot_from_dump(data_dump_path: Path):
    assert MIPSnapshot.from_dump(data_dump_path)


def test_from_web():
    assert MIPSnapshot.from_web()


def test_from_web_latest():
    assert MIPSnapshot.from_web_latest()