File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1584,6 +1584,31 @@ def test_coclustering_results_simple_edge_cases(self):
15841584 dimension .init_summary (json_data = "NOT A DICT" )
15851585 with self .assertRaises (TypeError ):
15861586 dimension .init_partition (json_data = "NOT A DICT" )
1587+ dimension .init_summary (json_data = {"name" : "PartName" , "type" : "Numerical" })
1588+ with self .assertRaises (kh .KhiopsJSONError ) as cm :
1589+ dimension .init_partition (
1590+ json_data = {
1591+ "name" : dimension .name ,
1592+ "type" : dimension .type ,
1593+ "intervals" : [],
1594+ }
1595+ )
1596+ self .assertIn (
1597+ "'intervals' key must have length at least 1" , cm .exception .args [0 ]
1598+ )
1599+ with self .assertRaises (kh .KhiopsJSONError ) as cm :
1600+ dimension .init_partition (
1601+ json_data = {
1602+ "name" : dimension .name ,
1603+ "type" : dimension .type ,
1604+ "intervals" : [None ],
1605+ }
1606+ )
1607+ self .assertIn (
1608+ "'intervals' key must have at least 2 elements when one element "
1609+ "contains missing values" ,
1610+ cm .exception .args [0 ],
1611+ )
15871612 with self .assertRaises (TypeError ):
15881613 dimension .init_hierarchy (json_data = "NOT A DICT" )
15891614 with self .assertRaises (TypeError ):
You can’t perform that action at this time.
0 commit comments