Skip to content

Commit 62157b6

Browse files
committed
ok now the dang tests should work and if they don't i'll cry
1 parent 329dbed commit 62157b6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

kafka/sasl/msk.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
from kafka.protocol.types import Int32
1212
import kafka.errors as Errors
1313

14-
import boto3
15-
from botocore.session import Session as BotoSession
16-
17-
1814

1915
def try_authenticate(self, future):
16+
from botocore.session import Session as BotoSession # importing it in advance is not an option apparently...
17+
2018
session = BotoSession()
2119
credentials = session.get_credentials().get_frozen_credentials()
2220
client = AwsMskIamClient(

test/test_msk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import datetime
22
import json
33

4-
from kafka.msk import AwsMskIamClient
4+
from kafka.sasl.msk import AwsMskIamClient
55

66
try:
77
from unittest import mock
@@ -11,7 +11,7 @@
1111

1212
def client_factory(token=None):
1313
now = datetime.datetime.utcfromtimestamp(1629321911)
14-
with mock.patch('kafka.msk.datetime') as mock_dt:
14+
with mock.patch('kafka.sasl.msk.datetime') as mock_dt:
1515
mock_dt.datetime.utcnow = mock.Mock(return_value=now)
1616
return AwsMskIamClient(
1717
host='localhost',

0 commit comments

Comments
 (0)