model_spec.py 636 Bytes
Newer Older
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
from mamba import describe, it, _it  # type: ignore
from robber import expect  # type: ignore

from splito.domain.audio_editing.model import Interval


with describe(Interval):

    with it("builds"):

        def action() -> None:
            _ = Interval(0, 1)

        expect(action).not_to.throw(Exception)

    with _it("does not build if start is after end"):

        def action() -> None:
            _ = Interval(1, 0)

        expect(action).to.throw(Exception)

    with _it("does not build if start is equal to end"):

        def action() -> None:
            _ = Interval(1, 1)

        expect(action).to.throw(Exception)