File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,9 +81,12 @@ def _populate(self, json):
8181 """
8282 Parse Nodes into more useful LKENodePoolNode objects
8383 """
84- if json != {}:
84+ if json is not None and json != {}:
8585 new_nodes = [
86- LKENodePoolNode (self ._client , c ) for c in json ["nodes" ]
86+ LKENodePoolNode (self ._client , c )
87+ if not isinstance (c , dict )
88+ else c
89+ for c in json ["nodes" ]
8790 ]
8891 json ["nodes" ] = new_nodes
8992
Original file line number Diff line number Diff line change @@ -132,3 +132,17 @@ def test_service_token_delete(self):
132132 with self .mock_delete () as m :
133133 cluster .service_token_delete ()
134134 self .assertEqual (m .call_url , "/lke/clusters/18881/servicetoken" )
135+
136+ def test_load_node_pool (self ):
137+ """
138+ Tests that an LKE Node Pool can be retrieved using LinodeClient.load(...)
139+ """
140+ pool = self .client .load (LKENodePool , 456 , 18881 )
141+
142+ self .assertEqual (pool .id , 456 )
143+ self .assertEqual (pool .cluster_id , 18881 )
144+ self .assertEqual (pool .type .id , "g6-standard-4" )
145+ self .assertIsNotNone (pool .disks )
146+ self .assertIsNotNone (pool .nodes )
147+ self .assertIsNotNone (pool .autoscaler )
148+ self .assertIsNotNone (pool .tags )
You can’t perform that action at this time.
0 commit comments