Skip to content

Commit b4432c4

Browse files
Fixed snyk issues, fixed test files variable name mismatches and deleted unused github action file
1 parent f25d5ca commit b4432c4

File tree

5 files changed

+17
-39
lines changed

5 files changed

+17
-39
lines changed

.github/workflows/sast-scan.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/secrets-scan.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pytz==2023.3
3333
Babel==2.12.1
3434
pep517==0.13.0
3535
tomli~=2.0.1
36-
Werkzeug==2.3.4
36+
Werkzeug==3.0.1
3737
Flask~=2.3.2
3838
click~=8.1.3
3939
MarkupSafe==2.1.2
@@ -59,6 +59,6 @@ distlib~=0.3.6
5959
Empty~=0.4.4
6060
cachetools~=5.3.0
6161
tomlkit~=0.11.8
62-
urllib3==2.0.2
62+
urllib3==2.0.7
6363
exceptiongroup~=1.1.1
6464
iniconfig~=2.0.0

tests/test_assets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ def setUp(self):
2323
def test_011_setting_timeout(self):
2424
excepted = 13 # setting a custom timeout
2525
self.stack = contentstack.Stack(
26-
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, host=config.host, timeout=excepted)
26+
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, host=config.HOST, timeout=excepted)
2727
self.assertEqual(excepted, self.stack.timeout)
2828

2929
def test_12_setting_timeout_failure(self):
3030
try:
3131
excepted = 1.00 # setting a custom timeout
3232
self.stack = contentstack.Stack(
33-
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, host=config.host, timeout=excepted)
33+
API_KEY, DELIVERY_TOKEN, ENVIRONMENT, host=config.HOST, timeout=excepted)
3434
self.stack.asset_query().find()
3535
except TimeoutError:
3636
self.assertEqual('Timeout expired.', TimeoutError.__doc__)

tests/test_stack.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ def test_02_stack_region(self):
2828
self.assertEqual('eu-cdn.contentstack.com', stack_region.host)
2929

3030
def test_03_stack_endpoint(self):
31-
self.assertEqual(f"https://{config.host}/v3",
31+
self.assertEqual(f"https://{config.HOST}/v3",
3232
self.stack.endpoint)
3333

3434
def test_04_permission_error_api_key(self):
3535
try:
3636
stack_local = contentstack.Stack(
37-
'', config.delivery_token, config.environment)
37+
'', config.DELIVERYTOKEN, config.ENVIRONMENT)
3838
self.assertEqual(None, stack_local.api_key)
3939
except PermissionError as e:
4040
if hasattr(e, 'message'):
@@ -43,7 +43,7 @@ def test_04_permission_error_api_key(self):
4343

4444
def test_05_permission_error_delivery_token(self):
4545
try:
46-
stack = contentstack.Stack(config.api_key, '', config.environment)
46+
stack = contentstack.Stack(config.APIKEY, '', config.ENVIRONMENT)
4747
self.assertEqual(None, stack.delivery_token)
4848
except PermissionError as e:
4949
if hasattr(e, 'message'):
@@ -53,7 +53,7 @@ def test_05_permission_error_delivery_token(self):
5353
def test_05_permission_error_environment(self):
5454
try:
5555
stack = contentstack.Stack(
56-
config.api_key, config.delivery_token, '')
56+
config.APIKEY, config.DELIVERYTOKEN, '')
5757
self.assertEqual(None, stack.delivery_token)
5858
except PermissionError as e:
5959
if hasattr(e, 'message'):
@@ -62,22 +62,22 @@ def test_05_permission_error_environment(self):
6262

6363
def test_07_get_api_key(self):
6464
stack = contentstack.Stack(
65-
config.api_key, config.delivery_token, config.environment)
66-
self.assertEqual(config.api_key, stack.get_api_key)
65+
config.APIKEY, config.DELIVERYTOKEN, config.ENVIRONMENT)
66+
self.assertEqual(config.APIKEY, stack.get_api_key)
6767

6868
def test_08_get_delivery_token(self):
6969
stack = contentstack.Stack(
70-
config.api_key, config.delivery_token, config.environment)
71-
self.assertEqual(config.delivery_token, stack.get_delivery_token)
70+
config.APIKEY, config.DELIVERYTOKEN, config.ENVIRONMENT)
71+
self.assertEqual(config.DELIVERYTOKEN, stack.get_delivery_token)
7272

7373
def test_09_get_environment(self):
7474
stack = contentstack.Stack(
75-
config.api_key, config.delivery_token, config.environment)
76-
self.assertEqual(config.environment, stack.get_environment)
75+
config.APIKEY, config.DELIVERYTOKEN, config.ENVIRONMENT)
76+
self.assertEqual(config.ENVIRONMENT, stack.get_environment)
7777

7878
def test_10_get_headers(self):
7979
stack = contentstack.Stack(
80-
config.api_key, config.delivery_token, config.environment)
80+
config.APIKEY, config.DELIVERYTOKEN, config.ENVIRONMENT)
8181
self.assertEqual(True, 'api_key' in stack.headers)
8282
self.assertEqual(True, 'access_token' in stack.get_headers)
8383
self.assertEqual(True, 'environment' in stack.get_headers)
@@ -163,7 +163,7 @@ def test_21_content_type(self):
163163
def test_check_region(self):
164164
"""_summary_
165165
"""
166-
_stack = contentstack.Stack(config.api_key, config.delivery_token, config.environment,
167-
host=config.host, region=ContentstackRegion.AZURE_NA)
166+
_stack = contentstack.Stack(config.APIKEY, config.DELIVERYTOKEN, config.ENVIRONMENT,
167+
host=config.HOST, region=ContentstackRegion.AZURE_NA)
168168
var = _stack.region.value
169169
self.assertEqual('azure-na', var)

0 commit comments

Comments
 (0)