Skip to content

Commit

Permalink
cleanup and updates (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Jul 16, 2018
1 parent eef51a8 commit 371e56a
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 26 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ requests==2.19.1 # via kubernetes, requests-oauthlib
rsa==3.4.2 # via google-auth
sanic==0.7.0
six==1.11.0 # via google-auth, grpcio, kubernetes, protobuf, python-dateutil, websocket-client
synse-grpc==1.0.1 # via https://pypi.org/project/synse-grpc/ For dev workflow, copy to this repo and change Dockerfile to use copy.
synse-grpc==1.0.1
ujson==1.35 # via sanic
urllib3==1.23 # via kubernetes, requests
uvloop==0.9.1 # via sanic
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'kubernetes',
'pyyaml',
'sanic',
'synse-grpc',
'synse-grpc>=1.0.1',
],
tests_require=[
'aiohttp',
Expand Down
4 changes: 2 additions & 2 deletions synse/locale/en_US/LC_MESSAGES/synse.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Synse Server VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2018-07-09 09:31-0400\n"
"POT-Creation-Date: 2018-07-16 15:09-0400\n"
"PO-Revision-Date: 2018-04-23 14:33-0400\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: en_US\n"
Expand Down Expand Up @@ -75,7 +75,7 @@ msgstr ""
msgid "Building the scan cache"
msgstr ""

#: synse/cache.py:607
#: synse/cache.py:625
msgid "Building the info cache"
msgstr ""

Expand Down
4 changes: 2 additions & 2 deletions synse/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from synse.proto import client


class PluginManager(object):
class PluginManager:
"""Manager for all registered background plugins.
Only a single instance of the PluginManager should be used. It is
Expand Down Expand Up @@ -107,7 +107,7 @@ def purge(self, ids):
logger.debug(_('PluginManager purged plugins: {}').format(ids))


class Plugin(object):
class Plugin:
"""The Plugin object models a Synse Plugin that has been registered with
Synse Server. It holds the Plugin metadata as well as a reference to a client
for communicating with the plugin via the Synse gRPC API.
Expand Down
4 changes: 2 additions & 2 deletions synse/proto/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from synse.log import logger


class WriteData(object):
class WriteData:
"""The WriteData object is a convenient way to group together
write actions and raw data into a single bundle for a single write
transaction.
Expand Down Expand Up @@ -49,7 +49,7 @@ def to_grpc(self):
)


class PluginClient(object):
class PluginClient:
"""The `PluginClient` class provides an interface to Synse Plugins
via the Synse Plugin gRPC API.
Expand Down
2 changes: 1 addition & 1 deletion synse/scheme/base_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from synse.response import json


class SynseResponse(object):
class SynseResponse:
"""SynseResponse is the base object for all implemented response
schemes.
Expand Down
2 changes: 1 addition & 1 deletion synse/scheme/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def format_readings(self):
# to have no data if:
# - the ReadResponse value comes back as an empty string (e.g. "")
# - the ReadResponse value comes back as the string "null".
if value == '' or value == 'null':
if value in ('', 'null'):
logger.info(_('Reading value for {} came back as empty/null').format(rt))
value = None

Expand Down
Binary file removed synse_grpc-1.0.0.tar.gz
Binary file not shown.
22 changes: 11 additions & 11 deletions tests/end_to_end/test_synse.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# Test Utilities
# -------------------------------

class EmulatorDevices(object):
class EmulatorDevices:
"""EmulatorDevices is a container that defines the well-known device
IDs for the emulator devices. Since the emulator is configured the
same way for these tests, it should always produce the same device
Expand Down Expand Up @@ -311,7 +311,7 @@ def validate_scan_board(board):
# Status
#

class TestStatus(object):
class TestStatus:
"""Tests for the 'test' route."""

def test_status_ok(self):
Expand All @@ -329,7 +329,7 @@ def test_status_ok(self):
# Version
#

class TestVersion(object):
class TestVersion:
"""Tests for the 'version' route."""

def test_version_ok(self):
Expand All @@ -348,7 +348,7 @@ def test_version_ok(self):
# Config
#

class TestConfig(object):
class TestConfig:
"""Tests for the 'config' route."""

def test_config_ok(self):
Expand Down Expand Up @@ -388,7 +388,7 @@ def test_config_ok(self):
# Plugins
#

class TestPlugins(object):
class TestPlugins:
"""Tests for the 'plugins' route."""

def test_plugins_ok(self):
Expand Down Expand Up @@ -428,7 +428,7 @@ def test_plugins_ok(self):
# Scan
#

class TestScan(object):
class TestScan:
"""Tests for the 'scan' route."""

@pytest.mark.parametrize(
Expand Down Expand Up @@ -513,7 +513,7 @@ def test_scan_bad_params(self, params):
# Read
#

class TestRead(object):
class TestRead:
"""Tests for the 'read' route."""

@pytest.mark.parametrize(
Expand Down Expand Up @@ -569,7 +569,7 @@ def test_read_bad_query_params(self):
# Write
#

class TestWrite(object):
class TestWrite:
"""Tests for the 'write' route."""

@pytest.mark.parametrize(
Expand Down Expand Up @@ -654,7 +654,7 @@ def test_write_invalid_json(self, data):
# Info
#

class TestInfo(object):
class TestInfo:
"""Tests for the 'info' route."""

def test_rack_info_no_ctx(self):
Expand Down Expand Up @@ -763,7 +763,7 @@ def test_device_info_error(self):
# LED
#

class TestLED(object):
class TestLED:
"""Tests for the 'led' route."""

@pytest.mark.parametrize(
Expand Down Expand Up @@ -864,7 +864,7 @@ def test_led_write_bad_params(self, device, params):
# Fan
#

class TestFan(object):
class TestFan:
"""Tests for the 'fan' route."""

@pytest.mark.parametrize(
Expand Down
1 change: 0 additions & 1 deletion tests/unit/commands/test_plugins_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def disable_register():
# the plugins won't be in standard places so we disable registration.
def passthru():
"""Passthrough function for testing."""
return

plugin.register_plugins = passthru

Expand Down
1 change: 0 additions & 1 deletion tests/unit/routes/aliases/test_boot_target_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def mock_read(monkeypatch):

def mockvalidatedevicetype(device_type, rack, board, device):
"""Mock method that will be used in mokeypatching the validate device type method."""
return


@pytest.fixture()
Expand Down
1 change: 0 additions & 1 deletion tests/unit/routes/aliases/test_fan_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def mock_read(monkeypatch):

def mockvalidatedevicetype(device_type, rack, board, device):
"""Mock method that will be used in mokeypatching the validate device type method."""
return


@pytest.fixture()
Expand Down
1 change: 0 additions & 1 deletion tests/unit/routes/aliases/test_led_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def mock_read(monkeypatch):

def mockvalidatedevicetype(device_type, rack, board, device):
"""Mock method that will be used in mokeypatching the validate device type method."""
return


@pytest.fixture()
Expand Down
1 change: 0 additions & 1 deletion tests/unit/routes/aliases/test_power_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def mock_read(monkeypatch):

def mockvalidatedevicetype(device_type, rack, board, device):
"""Mock method that will be used in mokeypatching the validate device type method."""
return


@pytest.fixture()
Expand Down

0 comments on commit 371e56a

Please sign in to comment.