-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test deploy farm service not on Github
- Loading branch information
Martin op iMac
committed
Oct 31, 2023
1 parent
d7d6834
commit e96cefe
Showing
1 changed file
with
11 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
# Import what we need for testing | ||
import unittest | ||
from main import app | ||
|
||
class TestApp(unittest.TestCase): | ||
|
||
def test_index(self): | ||
# Create a test client using the Flask app context | ||
with app.test_client() as client: | ||
# Make a GET request to the index route | ||
response = client.get('/') | ||
# Check that the response status code is 200 OK | ||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_cow(self): | ||
# Create a test client using the Flask app context | ||
with app.test_client() as client: | ||
# Make a GET request to the cow route | ||
response = client.get('/cow') | ||
# Check that the response status code is 200 OK | ||
self.assertEqual(response.status_code, 200) | ||
# Check that the response data is the expected string | ||
# self.assertEqual(response.data.decode('utf-8'), 'MOoooOo!') | ||
def add_numbers(a, b): | ||
return a + b | ||
|
||
|
||
def main(): | ||
result = add_numbers(2, 3) | ||
print(result) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |