Skip to content

Commit

Permalink
[#187500774]: use API key instead of password
Browse files Browse the repository at this point in the history
  • Loading branch information
rchacon1 committed Apr 25, 2024
1 parent e75284c commit 8f31063
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 38 deletions.
6 changes: 2 additions & 4 deletions integration/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
"body": b
}


HOST = os.environ["SCRUNCH_HOST"]
username = os.environ["SCRUNCH_USER"]
password = os.environ["SCRUNCH_PASS"]
api_key = os.environ["SCRUNCH_APIKEY"]

site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
assert site is not None, "Unable to connect to %s" % HOST


Expand Down
9 changes: 3 additions & 6 deletions integration/test_backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
from scrunch import connect
from scrunch.mutable_dataset import get_mutable_dataset

HOST = os.environ["SCRUNCH_HOST"]
api_key = os.environ["SCRUNCH_APIKEY"]

HOST = os.environ['SCRUNCH_HOST']
username = os.environ['SCRUNCH_USER']
password = os.environ['SCRUNCH_PASS']


site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
assert site is not None, "Unable to connect to %s" % HOST

as_entity = lambda b: {
Expand Down
8 changes: 3 additions & 5 deletions integration/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
from scrunch import connect
from scrunch.mutable_dataset import get_mutable_dataset

HOST = os.environ['SCRUNCH_HOST']
username = os.environ['SCRUNCH_USER']
password = os.environ['SCRUNCH_PASS']
HOST = os.environ["SCRUNCH_HOST"]
api_key = os.environ["SCRUNCH_APIKEY"]


site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
assert site is not None, "Unable to connect to %s" % HOST

as_entity = lambda b: {
Expand Down
9 changes: 4 additions & 5 deletions integration/test_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
from scrunch.exceptions import InvalidPathError
from scrunch.folders import Folder

HOST = os.environ["SCRUNCH_HOST"]
api_key = os.environ["SCRUNCH_APIKEY"]

HOST = os.environ['SCRUNCH_HOST']
username = os.environ['SCRUNCH_USER']
password = os.environ['SCRUNCH_PASS']

site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
assert site is not None, "Unable to connect to %s" % HOST


def setup_folders(ds):
Expand Down
9 changes: 4 additions & 5 deletions integration/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@


HOST = os.environ['SCRUNCH_HOST']
username = os.environ['SCRUNCH_USER']
password = os.environ['SCRUNCH_PASS']
api_key = os.environ["SCRUNCH_APIKEY"]
api_key2 = os.environ["SCRUNCH_APIKEY2"]
username2 = os.environ['SCRUNCH_USER2']
password2 = os.environ['SCRUNCH_PASS2']

site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
UNIQUE_PREFIX = str(datetime.now()).replace(':', '').replace('.', '')
FEATURE_FLAG = 'old_projects_order'

Expand Down Expand Up @@ -76,7 +75,7 @@ def test_reorder(self):

def test_move_dataset(self):
fo = get_user(username2)
fo_site = connect(fo.email, password2, HOST)
fo_site = connect(api_key=api_key2, site_url=HOST)

# These two datasets are created by the default logged user
_ds1 = site.datasets.create(shoji_entity_wrapper({
Expand Down
9 changes: 3 additions & 6 deletions integration/test_recodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@
from scrunch.mutable_dataset import get_mutable_dataset
from pycrunch.importing import Importer

HOST = os.environ["SCRUNCH_HOST"]
api_key = os.environ["SCRUNCH_APIKEY"]

HOST = os.environ['SCRUNCH_HOST']
username = os.environ['SCRUNCH_USER']
password = os.environ['SCRUNCH_PASS']


site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
assert site is not None, "Unable to connect to %s" % HOST


Expand Down
6 changes: 2 additions & 4 deletions integration/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
from scrunch.scripts import ScriptExecutionError
from scrunch.mutable_dataset import get_mutable_dataset


HOST = os.environ["SCRUNCH_HOST"]
username = os.environ["SCRUNCH_USER"]
password = os.environ["SCRUNCH_PASS"]
api_key = os.environ["SCRUNCH_APIKEY"]

site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
assert site is not None, "Unable to connect to %s" % HOST

as_entity = lambda b: {
Expand Down
5 changes: 2 additions & 3 deletions integration/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
from scrunch.mutable_dataset import get_mutable_dataset

HOST = os.environ["SCRUNCH_HOST"]
username = os.environ["SCRUNCH_USER"]
password = os.environ["SCRUNCH_PASS"]
api_key = os.environ["SCRUNCH_APIKEY"]

site = connect(username, password, HOST)
site = connect(api_key=api_key, site_url=HOST)
assert site is not None, "Unable to connect to %s" % HOST

as_entity = lambda b: {
Expand Down

0 comments on commit 8f31063

Please sign in to comment.