Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-sidelnikov committed Nov 27, 2024
1 parent ac12af0 commit f93a40a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions otcextensions/tests/unit/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,9 @@ def run(self):
if not data:
return
stat_key = data[0].decode('utf-8')
# Check if the stat_key looks like a tuple, e.g. ('key',):value|type
if stat_key.startswith("("):
# Split by ':' to separate the key from the value and type
key_value_pair = stat_key.split(":", 1)

# Remove the parentheses from the key part (i.e. ('key',) -> 'key')
key = key_value_pair[0].strip("()").strip("','")

# Rebuild the string with the clean key
stat_key = f"{key}:{key_value_pair[1]}"
self.stats.append(stat_key)
if fd == self.wake_read:
Expand Down Expand Up @@ -258,7 +252,7 @@ def test_sfsturbo_share(self):
{
"region": "RegionOne",
"interface": "public",
"url": "https://shared-file-system.example.com/v1",
"url": "https://sfs.example.com/v1",
}
],
},
Expand All @@ -277,9 +271,13 @@ def test_sfsturbo_share(self):
)
sdk.register_otc_extensions(self.cloud)
# Mock the get_access method to return the mock AccessInfoV3 object
with mock.patch.object(self.cloud.session.auth, 'get_access', return_value=mock_access_info):
with mock.patch.object(
self.cloud.session.auth,
'get_access',
return_value=mock_access_info
):
# Mock the URI registration for the requests
mock_uri = 'https://shared-file-system.example.com/v1/sfs-turbo/shares/detail'
mock_uri = 'https://sfs.example.com/v1/sfs-turbo/shares/detail'
self.register_uris(
[
dict(
Expand Down

0 comments on commit f93a40a

Please sign in to comment.