Skip to content

Commit

Permalink
fix: remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
felicijus committed Oct 1, 2024
1 parent 8293481 commit 45792f7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions pyzeebe/channel/utils.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import os
from typing import Optional

DEFAULT_HOSTNAME = "localhost"
DEFAULT_PORT = 26500
DEFAULT_ADDRESS = f"{DEFAULT_HOSTNAME}:{DEFAULT_PORT}"
DEFAULT_ZEEBE_ADDRESS = "localhost:26500"


def create_address(
grpc_address: Optional[str] = None,
) -> str:
if grpc_address:
return grpc_address
return os.getenv("ZEEBE_ADDRESS", DEFAULT_ADDRESS)
return os.getenv("ZEEBE_ADDRESS", DEFAULT_ZEEBE_ADDRESS)
3 changes: 1 addition & 2 deletions tests/unit/channel/insecure_channel_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from unittest.mock import Mock, patch
from uuid import uuid4

import grpc
import pytest

from pyzeebe import create_insecure_channel
from pyzeebe.channel.channel_options import get_channel_options
from pyzeebe.channel.utils import DEFAULT_HOSTNAME, DEFAULT_PORT, create_address
from pyzeebe.channel.utils import create_address


class TestCreateInsecureChannel:
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/channel/secure_channel_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from unittest.mock import Mock, patch
from uuid import uuid4

import grpc
import pytest

from pyzeebe import create_secure_channel
from pyzeebe.channel.channel_options import get_channel_options
from pyzeebe.channel.utils import DEFAULT_HOSTNAME, DEFAULT_PORT, create_address
from pyzeebe.channel.utils import create_address


class TestCreateSecureChannel:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/channel/utils_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from uuid import uuid4

from pyzeebe.channel.utils import DEFAULT_ADDRESS, create_address
from pyzeebe.channel.utils import DEFAULT_ZEEBE_ADDRESS, create_address


class TestCreateAddress:
Expand All @@ -14,7 +14,7 @@ def test_returns_passed_address(self):
def test_returns_default_address(self):
address = create_address()

assert address == DEFAULT_ADDRESS
assert address == DEFAULT_ZEEBE_ADDRESS

def test_returns_env_var_if_provided(self):
zeebe_address = str(uuid4())
Expand Down

0 comments on commit 45792f7

Please sign in to comment.