8000 start on Webapp class · pythonanywhere/helper_scripts@e33ec5f · GitHub
[go: up one dir, main page]

Skip to content

Commit e33ec5f

Browse files
committed
start on Webapp class

1 parent 5618d64 commit e33ec5f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pythonanywhere/api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ class AuthenticationError(Exception):
2121

2222

2323

24+
class Webapp:
25+
def __init__(self, domain):
26+
self.domain = domain
27+
28+
29+
2430
def call_api(url, method, **kwargs):
2531
token = os.environ['API_TOKEN']
2632
response = requests.request(

tests/test_api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
API_ENDPOINT,
99
PYTHON_VERSIONS,
1010
AuthenticationError,
11+
Webapp,
1112
add_static_file_mappings,
1213
call_api,
1314
create_webapp,
@@ -24,6 +25,13 @@ def test_raises_on_401(self, api_token, api_responses):
2425
assert str(e.value) == 'Authentication error 401 calling API: nope'
2526

2627

28+
class TestWebapp:
29+
30+
def test_init(self):
31+
app = Webapp('www.my-domain.com')
32+
assert app.domain == 'www.my-domain.com'
33+
34+
2735

2836

2937
class TestCreateWebapp:

0 commit comments

Comments
 (0)
0