Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #516 from mozilla-services/bug/515
Browse files Browse the repository at this point in the history
bug: remove shared file inclusion for tests
  • Loading branch information
bbangert authored Jul 13, 2016
2 parents d1132b2 + 465bcb3 commit 2540a4c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions autopush/diagnostic_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, sysargs, use_files=True):

def _load_args(self, sysargs, use_files):
if use_files:
config_files = [
config_files = shared_config_files + [ # pragma: nocover
'/etc/autopush_endpoint.ini',
'~/.autopush_endpoint.ini',
'.autopush_endpoint.ini'
Expand All @@ -43,7 +43,7 @@ def _load_args(self, sysargs, use_files):

parser = configargparse.ArgumentParser(
description='Runs endpoint diagnostics.',
default_config_files=shared_config_files + config_files)
default_config_files=config_files)
parser.add_argument('endpoint', help="Endpoint to parse")

add_shared_args(parser)
Expand Down
8 changes: 4 additions & 4 deletions autopush/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _parse_connection(sysargs, use_files=True):
# For testing, do not use the configuration files since they can
# produce unexpected results.
if use_files: # pragma: nocover
config_files = [
config_files = shared_config_files + [ # pragma: nocover
'/etc/autopush_connection.ini',
'~/.autopush_connection.ini',
'.autopush_connection.ini'
Expand All @@ -205,7 +205,7 @@ def _parse_connection(sysargs, use_files=True):
config_files = [] # pragma: nocover
parser = configargparse.ArgumentParser(
description='Runs a Connection Node.',
default_config_files=shared_config_files + config_files)
default_config_files=config_files)
parser.add_argument('--config-connection',
help="Connection node configuration file path",
dest='config_file', is_config_file=True)
Expand Down Expand Up @@ -250,7 +250,7 @@ def _parse_connection(sysargs, use_files=True):
def _parse_endpoint(sysargs, use_files=True):
"""Parses out endpoint arguments for an autoendpoint node"""
if use_files:
config_files = [
config_files = shared_config_files + [
'/etc/autopush_endpoint.ini',
'~/.autopush_endpoint.ini',
'.autopush_endpoint.ini'
Expand All @@ -259,7 +259,7 @@ def _parse_endpoint(sysargs, use_files=True):
config_files = [] # pragma: nocover
parser = configargparse.ArgumentParser(
description='Runs an Endpoint Node.',
default_config_files=shared_config_files + config_files)
default_config_files=config_files)
parser.add_argument('--config-endpoint',
help="Endpoint node configuration file path",
dest='config_file', is_config_file=True)
Expand Down
4 changes: 2 additions & 2 deletions autopush/tests/test_diagnostic_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FakeDict(dict):
class DiagnosticCLITestCase(unittest.TestCase):
def _makeFUT(self, *args, **kwargs):
from autopush.diagnostic_cli import EndpointDiagnosticCLI
return EndpointDiagnosticCLI(*args, **kwargs)
return EndpointDiagnosticCLI(*args, use_files=False, **kwargs)

def test_basic_load(self):
cli = self._makeFUT([
Expand Down Expand Up @@ -56,5 +56,5 @@ def test_successfull_lookup(self, mock_settings_class):
run_endpoint_diagnostic_cli([
"--router_tablename=fred",
"http://something/wpush/v1/legit_endpoint",
])
], use_files=False)
mock_message_table.all_channels.assert_called()
4 changes: 2 additions & 2 deletions autopush/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def test_ssl(self):
"--ssl_dh_param=keys/dhparam.pem",
"--ssl_cert=keys/server.crt",
"--ssl_key=keys/server.key",
])
], False)

def test_bad_senderidlist(self):
endpoint_main([
Expand Down Expand Up @@ -277,7 +277,7 @@ def test_gcm_start(self):
"--gcm_enabled",
"""--senderid_list={"123":{"auth":"abcd"}}""",
"--s3_bucket=none",
])
], False)

@patch("requests.get")
def test_aws_ami_id(self, request_mock):
Expand Down

0 comments on commit 2540a4c

Please sign in to comment.