Skip to content

Commit 2c36f79

Browse files
fix SEA test
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent 44c241a commit 2c36f79

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

scripts/dependency_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import sys
1010
import argparse
1111
from packaging.specifiers import SpecifierSet
12+
from packaging.requirements import Requirement
1213
from pathlib import Path
1314

1415
class DependencyManager:
@@ -170,13 +171,13 @@ def generate_requirements(self, version_type="min", include_optional=False):
170171

171172
# First add main requirements
172173
for req in requirements:
173-
package_name = req.split('>=')[0].split('==')[0].split('<')[0]
174+
package_name = Requirement(req).name
174175
seen_packages.add(package_name)
175176
final_requirements.append(req)
176177

177178
# Then add transitive requirements that don't conflict
178179
for req in transitive_requirements:
179-
package_name = req.split('>=')[0].split('==')[0].split('<')[0]
180+
package_name = Requirement(req).name
180181
if package_name not in seen_packages:
181182
final_requirements.append(req)
182183

tests/unit/test_sea_http_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def test_make_request_success(self, mock_get_auth_headers, sea_http_client):
9696
# Setup mock response
9797
mock_response = Mock()
9898
mock_response.status = 200
99-
mock_response.json.return_value = {"result": "success"}
99+
# Mock response.data.decode() to return a valid JSON string
100+
mock_response.data.decode.return_value = '{"result": "success"}'
100101
mock_response.__enter__ = Mock(return_value=mock_response)
101102
mock_response.__exit__ = Mock(return_value=None)
102103

0 commit comments

Comments
 (0)