11import random
22import string
33
4- import integration_data
4+ import integration_space
55
66
77def random_string (length : int ) -> str :
88 return "" .join (random .choice (string .ascii_letters ) for _ in range (length ))
99
1010
1111def gen_random_base ():
12- obj = integration_data .Base (
12+ obj = integration_space .Base (
1313 vec_3d = [random .random () for _ in range (3 )],
1414 union_member = random .choice ([random .random (), random .randint (0 , 100 ), None ]),
1515 str_vec = [random_string (5 ) for _ in range (random .choice ([1 , 2 , 5 ]))],
@@ -20,7 +20,7 @@ def gen_random_base():
2020def gen_random_derived_one ():
2121 base_dict = gen_random_base ().model_dump ()
2222 base_dict .pop ("type" , None )
23- obj = integration_data .DerivedOne (
23+ obj = integration_space .DerivedOne (
2424 ** base_dict ,
2525 string_map = {
2626 random_string (5 ): random_string (5 ) for _ in range (random .choice ([1 , 2 , 5 ]))
@@ -32,17 +32,17 @@ def gen_random_derived_one():
3232def gen_random_derived_two ():
3333 base_dict = gen_random_base ().model_dump ()
3434 base_dict .pop ("type" , None )
35- obj = integration_data .DerivedTwo (** base_dict )
35+ obj = integration_space .DerivedTwo (** base_dict )
3636 return obj
3737
3838
3939def gen_random_non_poly_derived ():
40- obj = integration_data .NonPolyDerived (value = random .randint (0 , 100 ))
40+ obj = integration_space .NonPolyDerived (value = random .randint (0 , 100 ))
4141 return obj
4242
4343
4444def gen_random_integration_test ():
45- obj = integration_data .IntegrationTest (
45+ obj = integration_space .IntegrationTest (
4646 object_map = {
4747 random_string (5 ): random .choice (
4848 [gen_random_derived_one , gen_random_derived_two ]
@@ -58,15 +58,15 @@ def gen_random_integration_test():
5858 for _ in range (2 )
5959 ],
6060 enum_value = random .choice (
61- [integration_data .Enumeration .value1 , integration_data .Enumeration .value2 ]
61+ [integration_space .Enumeration .value1 , integration_space .Enumeration .value2 ]
6262 ),
6363 non_poly_derived = gen_random_non_poly_derived (),
6464 )
6565 return obj
6666
6767
6868def compare_integration_data (
69- lhs : integration_data .IntegrationTest , rhs : integration_data .IntegrationTest
69+ lhs : integration_space .IntegrationTest , rhs : integration_space .IntegrationTest
7070):
7171 assert lhs .non_poly_derived == rhs .non_poly_derived
7272 assert lhs .enum_value == rhs .enum_value
@@ -85,15 +85,15 @@ def compare_integration_data(
8585 compare_poly_structure (lhs .object_array [i ], rhs .object_array [i ])
8686
8787
88- def compare_poly_structure (lhs : integration_data .Base , rhs : integration_data .Base ):
88+ def compare_poly_structure (lhs : integration_space .Base , rhs : integration_space .Base ):
8989 assert all (abs (a - b ) < 1e-6 for a , b in zip (lhs .vec_3d , rhs .vec_3d ))
9090 if isinstance (lhs .union_member , float ) and isinstance (rhs .union_member , float ):
9191 assert abs (lhs .union_member - rhs .union_member ) < 1e-6
9292 else :
9393 assert lhs .union_member == rhs .union_member
9494 assert lhs .str_vec == rhs .str_vec
9595
96- if isinstance (lhs , integration_data .DerivedOne ):
96+ if isinstance (lhs , integration_space .DerivedOne ):
9797 assert lhs .string_map == rhs .string_map
98- elif isinstance (lhs , integration_data .DerivedTwo ):
98+ elif isinstance (lhs , integration_space .DerivedTwo ):
9999 assert lhs .optional_value == rhs .optional_value
0 commit comments