Skip to content

Commit

Permalink
test: use sys.path to add manager
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 committed Sep 17, 2020
1 parent 00c5238 commit c4c0741
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion iot/api-client/http_example/cloudiot_http_example_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import cloudiot_http_example

# Add manager for bootstrapping device registry / device for testing
from .. import manager
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'manager')) # noqa
import manager # noqa


cloud_region = 'us-central1'
Expand Down
3 changes: 2 additions & 1 deletion iot/api-client/mqtt_example/cloudiot_mqtt_example_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
from fixtures import test_device_id # noqa
from fixtures import device_and_gateways # noqa
# Add manager for bootstrapping device registry / device for testing
from .. import manager
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'manager')) # noqa
import cloudiot_mqtt_example # noqa
import manager # noqa


cloud_region = 'us-central1'
Expand Down
3 changes: 2 additions & 1 deletion iot/api-client/mqtt_example/cloudiot_mqtt_image_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import tempfile

# Add manager as library
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'manager')) # noqa
import cloudiot_mqtt_image # noqa
from .. import manager
import manager # noqa
from fixtures import test_topic # noqa
from fixtures import test_subscription # noqa
from fixtures import test_registry_id # noqa
Expand Down
3 changes: 2 additions & 1 deletion iot/api-client/mqtt_example/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
import pytest

# Add manager as library
from .. import manager
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'manager')) # noqa
import manager # noqa


cloud_region = 'us-central1'
Expand Down
4 changes: 3 additions & 1 deletion iot/api-client/mqtt_example/gateway_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import sys
import time

sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'manager')) # noqa
import cloudiot_mqtt_example # noqa
from .. import manager
import manager # noqa


logging.getLogger('googleapiclient.discovery_cache').setLevel(logging.CRITICAL)

Expand Down

0 comments on commit c4c0741

Please sign in to comment.