09e9f3545f
CodeQL / Analyze (push) Waiting to run
dependency-audit / pip-audit (push) Waiting to run
Test / Code Quality (push) Has been cancelled
Test / Test (macos-latest, Python 3.10) (push) Has been cancelled
Test / Test (macos-latest, Python 3.11) (push) Has been cancelled
Test / Test (macos-latest, Python 3.12) (push) Has been cancelled
Test / Test (macos-latest, Python 3.13) (push) Has been cancelled
Test / Test (macos-latest, Python 3.14) (push) Has been cancelled
Test / Test (ubuntu-latest, Python 3.10) (push) Has been cancelled
Test / Test (ubuntu-latest, Python 3.11) (push) Has been cancelled
Test / Test (ubuntu-latest, Python 3.12) (push) Has been cancelled
Test / Test (ubuntu-latest, Python 3.13) (push) Has been cancelled
Test / Test (ubuntu-latest, Python 3.14) (push) Has been cancelled
Test / Test (windows-latest, Python 3.10) (push) Has been cancelled
Test / Test (windows-latest, Python 3.11) (push) Has been cancelled
Test / Test (windows-latest, Python 3.12) (push) Has been cancelled
Test / Test (windows-latest, Python 3.13) (push) Has been cancelled
Test / Test (windows-latest, Python 3.14) (push) Has been cancelled
37 lines
976 B
Python
37 lines
976 B
Python
"""Tests for the source-label exception classes."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from notebooklm.exceptions import (
|
|
LabelError,
|
|
LabelNotFoundError,
|
|
NotebookLMError,
|
|
NotFoundError,
|
|
RPCError,
|
|
)
|
|
|
|
|
|
def test_label_error_is_base() -> None:
|
|
assert issubclass(LabelError, NotebookLMError)
|
|
|
|
|
|
def test_label_not_found_mro() -> None:
|
|
assert issubclass(LabelNotFoundError, NotFoundError)
|
|
assert issubclass(LabelNotFoundError, RPCError)
|
|
assert issubclass(LabelNotFoundError, LabelError)
|
|
|
|
|
|
def test_label_not_found_carries_id_and_method() -> None:
|
|
exc = LabelNotFoundError("label_1", method_id="I3xc3c")
|
|
assert exc.label_id == "label_1"
|
|
assert exc.method_id == "I3xc3c"
|
|
assert "label_1" in str(exc)
|
|
|
|
|
|
def test_label_not_found_catchable_as_each_base() -> None:
|
|
for base in (NotFoundError, RPCError, LabelError, NotebookLMError):
|
|
with pytest.raises(base):
|
|
raise LabelNotFoundError("label_1")
|