diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-08-04 14:22:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-04 14:22:40 -0700 |
commit | 68c8fa4ad01f8fef38708f257cb1c261cfac01ab (patch) | |
tree | 38d12fc11f82c492c68a4e04dbac26664862f541 /test | |
parent | 3c9b1b6fc498f95806ee12f67f84ea548ac1378f (diff) | |
parent | 025b69ef4ae22d1677904e99f924b9ef5a096e75 (diff) | |
download | kafka-python-68c8fa4ad01f8fef38708f257cb1c261cfac01ab.tar.gz |
Merge pull request #794 from dpkp/conn_metrics
Complete metrics instrumentation
Diffstat (limited to 'test')
-rw-r--r-- | test/test_client_async.py | 2 | ||||
-rw-r--r-- | test/test_coordinator.py | 7 | ||||
-rw-r--r-- | test/test_fetcher.py | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/test/test_client_async.py b/test/test_client_async.py index 8b3634a..b165f93 100644 --- a/test/test_client_async.py +++ b/test/test_client_async.py @@ -49,6 +49,7 @@ def test_bootstrap_success(conn): args, kwargs = conn.call_args assert args == ('localhost', 9092, socket.AF_UNSPEC) kwargs.pop('state_change_callback') + kwargs.pop('node_id') assert kwargs == cli.config conn.connect.assert_called_with() conn.send.assert_called_once_with(MetadataRequest[0]([])) @@ -62,6 +63,7 @@ def test_bootstrap_failure(conn): args, kwargs = conn.call_args assert args == ('localhost', 9092, socket.AF_UNSPEC) kwargs.pop('state_change_callback') + kwargs.pop('node_id') assert kwargs == cli.config conn.connect.assert_called_with() conn.close.assert_called_with() diff --git a/test/test_coordinator.py b/test/test_coordinator.py index 35598e8..4115c03 100644 --- a/test/test_coordinator.py +++ b/test/test_coordinator.py @@ -29,8 +29,7 @@ def client(conn): @pytest.fixture def coordinator(client): - return ConsumerCoordinator(client, SubscriptionState(), Metrics(), - 'consumer') + return ConsumerCoordinator(client, SubscriptionState(), Metrics()) def test_init(client, coordinator): @@ -42,7 +41,7 @@ def test_init(client, coordinator): @pytest.mark.parametrize("api_version", [(0, 8, 0), (0, 8, 1), (0, 8, 2), (0, 9)]) def test_autocommit_enable_api_version(client, api_version): coordinator = ConsumerCoordinator(client, SubscriptionState(), - Metrics(), 'consumer', + Metrics(), enable_auto_commit=True, group_id='foobar', api_version=api_version) @@ -362,7 +361,7 @@ def test_maybe_auto_commit_offsets_sync(mocker, api_version, group_id, enable, mock_exc = mocker.patch('kafka.coordinator.consumer.log.exception') client = KafkaClient(api_version=api_version) coordinator = ConsumerCoordinator(client, SubscriptionState(), - Metrics(), 'consumer', + Metrics(), api_version=api_version, enable_auto_commit=enable, group_id=group_id) diff --git a/test/test_fetcher.py b/test/test_fetcher.py index 1f1f7d3..6afd547 100644 --- a/test/test_fetcher.py +++ b/test/test_fetcher.py @@ -30,7 +30,7 @@ def fetcher(client, subscription_state): subscription_state.assign_from_subscribed(assignment) for tp in assignment: subscription_state.seek(tp, 0) - return Fetcher(client, subscription_state, Metrics(), 'test_fetcher') + return Fetcher(client, subscription_state, Metrics()) def test_init_fetches(fetcher, mocker): |