@@ -20,6 +20,19 @@ def test_base_topic_extra():
2020 BaseTopic (name = "name" , key = "key" , description = "description" , foo = "bar" )
2121
2222
23+ def test_topic_filter_validation ():
24+ with pytest .raises (ValidationError ):
25+ Topic (
26+ endpoint = "elements" ,
27+ aggregation_type = ["area" , "count" , "length" , "perimeter" , "area/density" ],
28+ filter = "filter" ,
29+ indicators = ["indicators" ],
30+ projects = ["projects" ],
31+ source = "source" ,
32+ ratio_filter = "ratio_filter" ,
33+ )
34+
35+
2336def test_topic_definition ():
2437 Topic (
2538 key = "key" ,
@@ -29,7 +42,7 @@ def test_topic_definition():
2942 projects = ["core" ],
3043 endpoint = "elements" ,
3144 aggregation_type = "count" ,
32- filter = "filter " ,
45+ filter = "geometry " ,
3346 )
3447 Topic (
3548 key = "key" ,
@@ -39,7 +52,7 @@ def test_topic_definition():
3952 projects = ["core" ],
4053 endpoint = "elements" ,
4154 aggregation_type = "count" ,
42- filter = "filter " ,
55+ filter = "geometry " ,
4356 source = "source" ,
4457 )
4558 Topic (
@@ -50,7 +63,7 @@ def test_topic_definition():
5063 projects = ["core" ],
5164 endpoint = "elements" ,
5265 aggregation_type = "count" ,
53- filter = "filter " ,
66+ filter = "geometry " ,
5467 source = "source" ,
5568 )
5669 Topic (
@@ -61,7 +74,7 @@ def test_topic_definition():
6174 projects = ["core" , "experimental" ],
6275 endpoint = "elements" ,
6376 aggregation_type = "count" ,
64- filter = "filter " ,
77+ filter = "geometry " ,
6578 source = "source" ,
6679 )
6780 Topic (
@@ -72,7 +85,7 @@ def test_topic_definition():
7285 projects = ["core" ],
7386 endpoint = "elements" ,
7487 aggregation_type = "count" ,
75- filter = "filter " ,
88+ filter = "geometry " ,
7689 source = "source" ,
7790 )
7891 Topic (
@@ -83,7 +96,7 @@ def test_topic_definition():
8396 projects = ["core" ],
8497 endpoint = "elements" ,
8598 aggregation_type = "count" ,
86- filter = "filter " ,
99+ filter = "geometry " ,
87100 source = "source" ,
88101 ratio_filter = "ration_filter" ,
89102 )
0 commit comments