File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111- Added testing infrastructure (pytest, GitHub Action).
1212
13+ - Added tests for series reading.
14+
1315- Added ruff as a development dependency.
1416
1517
Original file line number Diff line number Diff line change 1+ """
2+ :Copyright: 2024 Jochen Kupperschmidt
3+ :License: MIT
4+ """
5+
6+ import pytest
7+
8+ from lanpartydb .models import Series
9+ from lanpartydb .reading import read_series_list_from_toml
10+
11+
12+ @pytest .mark .parametrize (
13+ ('toml' , 'expected' ),
14+ [
15+ (
16+ """
17+ """ ,
18+ [],
19+ ),
20+ (
21+ """
22+ [[series]]
23+ slug = "megalan"
24+ name = "MegaLAN"
25+ """ ,
26+ [
27+ Series (
28+ slug = 'megalan' ,
29+ name = 'MegaLAN' ,
30+ ),
31+ ],
32+ ),
33+ (
34+ """
35+ [[series]]
36+ slug = "gammalan"
37+ name = "GammaLAN"
38+ country_codes = ["ca", "us"]
39+
40+ [[series]]
41+ slug = "deltalan"
42+ name = "DeltaLAN"
43+ alternative_names = ["Δ LAN", "Δέλτα LAN"]
44+ country_codes = ["au"]
45+ """ ,
46+ [
47+ Series (
48+ slug = 'gammalan' ,
49+ name = 'GammaLAN' ,
50+ alternative_names = [],
51+ country_codes = ['ca' , 'us' ],
52+ ),
53+ Series (
54+ slug = 'deltalan' ,
55+ name = 'DeltaLAN' ,
56+ alternative_names = ['Δ LAN' , 'Δέλτα LAN' ],
57+ country_codes = ['au' ],
58+ ),
59+ ],
60+ ),
61+ ],
62+ )
63+ def test_read_series_list_from_toml (toml : str , expected : list [Series ]):
64+ assert read_series_list_from_toml (toml ) == expected
You can’t perform that action at this time.
0 commit comments