Skip to content

Commit

Permalink
Incremented the project version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pat Daburu committed Jun 12, 2019
1 parent d21fb5a commit 15ca837
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
11 changes: 2 additions & 9 deletions elastalk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

class Info(object):
"""
This is an information object that can be used to pass data between CLI functions.
This is an information object that can be used to pass data between CLI
functions.
"""
def __init__(self): # Note that this object must have an empty constructor.
self.verbose: int = 0
Expand Down Expand Up @@ -72,14 +73,6 @@ def cli(info: Info,
)
info.verbose = verbose

@cli.command()
@pass_info
def hello(_: Info):
"""
Say 'hello' to the nice people.
"""
click.echo(f"elastalk says 'hello'")


@cli.command()
def version():
Expand Down
8 changes: 3 additions & 5 deletions elastalk/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def __init__(self, config: ElastalkConf = None):
config if config else ElastalkConf()
) #: the configuration
# The Elasticsearch client will be created on demand.
self._client: elasticsearch.Elasticsearch = (
None
) #: the Elasticsearch client
self._client: elasticsearch.Elasticsearch or None = None

@property
def config(self) -> ElastalkConf:
Expand Down Expand Up @@ -188,7 +186,7 @@ def _encode(doc: Dict) -> str:
return enc_ascii.decode('utf-8')


def _decode(encoded: str) -> Dict:
def _decode(encoded: bytes) -> Dict:
"""
Decode an dictionary (document) encoded as a base64-encoded string.
Expand All @@ -201,7 +199,7 @@ def _decode(encoded: str) -> Dict:
return json.loads(dec_bytes.decode('utf-8'))


class ElastalkMixin(object):
class ElastalkMixin:
"""
Mix this into your class to get easy access to the Elasticsearch client.
"""
Expand Down
4 changes: 2 additions & 2 deletions elastalk/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
This module contains project version information.
"""

__version__ = '6.5.2' #: the working version
__release__ = '6.5.2' #: the release version
__version__ = '6.5.2.1' #: the working version
__release__ = '6.5.2.1' #: the release version
11 changes: 0 additions & 11 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,3 @@ def test_verbose_output():
result: Result = runner.invoke(cli.cli, ['-v', 'version'])
assert 'Verbose' in result.output.strip(), \
'Verbose logging should be indicated in output.'


def test_hello_displays_expected_message():
"""
Arrange/Act: Run the `version` subcommand.
Assert: The output matches the library version.
"""
runner: CliRunner = CliRunner()
result: Result = runner.invoke(cli.cli, ['hello'])
assert 'elastalk' in result.output.strip(), \
"'Hello' messages should contain the CLI name."
2 changes: 1 addition & 1 deletion tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_client_set_config():
cfg1 = ElastalkConf(seeds=['127.0.0.1'])
es_cnx = ElastalkConnection(config=cfg1)
es1 = es_cnx.client
cfg2 = ElastalkConf(seeds=['test.geo-comm.com'])
cfg2 = ElastalkConf(seeds=['test.daburu.net'])
es_cnx.config = cfg2
es2 = es_cnx.client

Expand Down

0 comments on commit 15ca837

Please sign in to comment.