Skip to content

Commit

Permalink
ok now the dang tests should work and if they don't i'll cry
Browse files Browse the repository at this point in the history
  • Loading branch information
wbarnha committed Mar 18, 2024
1 parent 329dbed commit 62157b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions kafka/sasl/msk.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
from kafka.protocol.types import Int32
import kafka.errors as Errors

import boto3
from botocore.session import Session as BotoSession



def try_authenticate(self, future):
from botocore.session import Session as BotoSession # importing it in advance is not an option apparently...

session = BotoSession()
credentials = session.get_credentials().get_frozen_credentials()
client = AwsMskIamClient(
Expand Down
4 changes: 2 additions & 2 deletions test/test_msk.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime
import json

from kafka.msk import AwsMskIamClient
from kafka.sasl.msk import AwsMskIamClient

try:
from unittest import mock
Expand All @@ -11,7 +11,7 @@

def client_factory(token=None):
now = datetime.datetime.utcfromtimestamp(1629321911)
with mock.patch('kafka.msk.datetime') as mock_dt:
with mock.patch('kafka.sasl.msk.datetime') as mock_dt:
mock_dt.datetime.utcnow = mock.Mock(return_value=now)
return AwsMskIamClient(
host='localhost',
Expand Down

0 comments on commit 62157b6

Please sign in to comment.