Skip to content

Commit

Permalink
fix test env.
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseshieh committed May 28, 2020
1 parent 074e7f2 commit ae4dbb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gigalixir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def detect_app():

@click.group(cls=AliasedGroup, context_settings=CONTEXT_SETTINGS)
# @click.group(cls=CatchAllExceptions(AliasedGroup, handler=handle_exception), context_settings=CONTEXT_SETTINGS)
@click.option('--env', envvar='GIGALIXIR_ENV', default='prod', help="GIGALIXIR environment [prod, dev].")
@click.option('--env', envvar='GIGALIXIR_ENV', default='prod', help="GIGALIXIR environment [prod, dev, test].")
@click.pass_context
def cli(ctx, env):
ctx.obj = {}
Expand All @@ -220,6 +220,11 @@ def cli(ctx, env):
elif env == "dev":
stripe.api_key = 'pk_test_6tMDkFKTz4N0wIFQZHuzOUyW'
host = "http://localhost:4000"
elif env == "test":
stripe.api_key = 'pk_test_6tMDkFKTz4N0wIFQZHuzOUyW'

# gets intercepted in tests
host = "https://api.gigalixir.com"
else:
raise Exception("Invalid GIGALIXIR_ENV")

Expand Down
3 changes: 3 additions & 0 deletions gigalixir/netrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def update_netrc(email, key, env):
netrc_file.hosts['api.gigalixir.com'] = (email, None, key)
elif env == 'dev':
netrc_file.hosts['localhost'] = (email, None, key)
elif env == 'test':
netrc_file.hosts['git.gigalixir.com'] = (email, None, key)
netrc_file.hosts['api.gigalixir.com'] = (email, None, key)
else:
raise Exception('Invalid env: %s' % env)

Expand Down

0 comments on commit ae4dbb8

Please sign in to comment.