File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
scaleway-core/scaleway_core Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -140,11 +140,12 @@ def _request(
140
140
141
141
headers = {
142
142
"accept" : "application/json" ,
143
- "x-auth-token" : self .client .secret_key or "" ,
144
143
"user-agent" : self .client .user_agent ,
145
144
** additional_headers ,
146
145
** headers ,
147
146
}
147
+ if self .client .secret_key is not None :
148
+ headers ["x-auth-token" ] = self .client .secret_key
148
149
url = f"{ self .client .api_url } { path } "
149
150
150
151
logger = APILogger (self ._log , self .client ._increment_request_count ())
Original file line number Diff line number Diff line change
1
+ import logging
2
+ import sys
3
+ import unittest
4
+ from scaleway_core .client import Client
5
+ from scaleway .instance .v1 import InstanceV1API
6
+
7
+ logger = logging .getLogger ()
8
+ logger .level = logging .DEBUG
9
+ stream_handler = logging .StreamHandler (sys .stdout )
10
+ logger .addHandler (stream_handler )
11
+
12
+
13
+ class TestTotalCountLegacy (unittest .TestCase ):
14
+
15
+ def setUp (self ) -> None :
16
+ self .client = Client ()
17
+ self .instance_api = InstanceV1API (self .client , bypass_validation = True )
18
+
19
+ def test_list_servers_type (self ):
20
+ list_server_type = self .instance_api .list_servers_types (zone = "fr-par-1" )
21
+ self .assertIsNotNone (list_server_type .total_count )
22
+
23
+
You can’t perform that action at this time.
0 commit comments