@@ -37,11 +37,15 @@ def test_ctor(target_class):
3737 connection = CONNECTION ,
3838 max_batching_rows = MAX_BATCHING_ROWS ,
3939 user_defined_context = USER_DEFINED_CONTEXT ,
40+ container_cpu = "1.0" ,
41+ container_memory = "512M" ,
4042 )
4143 assert options .endpoint == ENDPOINT
4244 assert options .connection == CONNECTION
4345 assert options .max_batching_rows == MAX_BATCHING_ROWS
4446 assert options .user_defined_context == USER_DEFINED_CONTEXT
47+ assert options .container_cpu == "1.0"
48+ assert options .container_memory == "512M"
4549
4650
4751def test_empty_ctor (target_class ):
@@ -64,13 +68,17 @@ def test_from_api_repr(target_class):
6468 "connection" : CONNECTION ,
6569 "maxBatchingRows" : MAX_BATCHING_ROWS ,
6670 "userDefinedContext" : USER_DEFINED_CONTEXT ,
71+ "containerCpu" : "1.0" ,
72+ "containerMemory" : "512M" ,
6773 "someRandomField" : "someValue" ,
6874 }
6975 options = target_class .from_api_repr (resource )
7076 assert options .endpoint == ENDPOINT
7177 assert options .connection == CONNECTION
7278 assert options .max_batching_rows == MAX_BATCHING_ROWS
7379 assert options .user_defined_context == USER_DEFINED_CONTEXT
80+ assert options .container_cpu == "1.0"
81+ assert options .container_memory == "512M"
7482 assert options ._properties ["someRandomField" ] == "someValue"
7583
7684
@@ -81,6 +89,8 @@ def test_from_api_repr_w_minimal_resource(target_class):
8189 assert options .connection is None
8290 assert options .max_batching_rows is None
8391 assert options .user_defined_context is None
92+ assert options .container_cpu is None
93+ assert options .container_memory is None
8494
8595
8696def test_from_api_repr_w_unknown_fields (target_class ):
@@ -95,12 +105,16 @@ def test_eq(target_class):
95105 connection = CONNECTION ,
96106 max_batching_rows = MAX_BATCHING_ROWS ,
97107 user_defined_context = USER_DEFINED_CONTEXT ,
108+ container_cpu = "1.0" ,
109+ container_memory = "512M" ,
98110 )
99111 other_options = target_class (
100112 endpoint = ENDPOINT ,
101113 connection = CONNECTION ,
102114 max_batching_rows = MAX_BATCHING_ROWS ,
103115 user_defined_context = USER_DEFINED_CONTEXT ,
116+ container_cpu = "1.0" ,
117+ container_memory = "512M" ,
104118 )
105119 assert options == other_options
106120 assert not (options != other_options )
@@ -120,8 +134,12 @@ def test_repr(target_class):
120134 connection = CONNECTION ,
121135 max_batching_rows = MAX_BATCHING_ROWS ,
122136 user_defined_context = USER_DEFINED_CONTEXT ,
137+ container_cpu = "1.0" ,
138+ container_memory = "512M" ,
123139 )
124140 actual_repr = repr (options )
125141 assert actual_repr == (
126- "RemoteFunctionOptions(connection='connection_string', endpoint='https://some.endpoint', max_batching_rows=50, user_defined_context={'foo': 'bar'})"
142+ "RemoteFunctionOptions(connection='connection_string', container_cpu='1.0', "
143+ "container_memory='512M', endpoint='https://some.endpoint', "
144+ "max_batching_rows=50, user_defined_context={'foo': 'bar'})"
127145 )
0 commit comments