Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python translation #61

Merged
merged 27 commits into from
Mar 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
81c8954
Basic flask application runs and has a unit test
emilybache Mar 2, 2023
9f58166
add gitignore
emilybache Mar 2, 2023
295b080
additional tests
emilybache Mar 2, 2023
9345250
it connects to the db now too
emilybache Mar 2, 2023
f532dd2
tests in place, translation begun
emilybache Mar 3, 2023
df34fe1
tests passing
emilybache Mar 3, 2023
53a6e9c
put is also working
emilybache Mar 3, 2023
05c138e
use same password as everyone else
emilybache Mar 3, 2023
b51de77
first attempt at github workflow
emilybache Mar 3, 2023
50148b2
attempt 2
emilybache Mar 3, 2023
ce6cc8e
attempt 3
emilybache Mar 3, 2023
1760dc8
attempt 4
emilybache Mar 3, 2023
7a93a1c
attempt 5
emilybache Mar 3, 2023
b178bec
attempt 6
emilybache Mar 3, 2023
9754809
attempt 7
emilybache Mar 3, 2023
5203c63
attempt 8
emilybache Mar 3, 2023
31ec8a5
attempt 9
emilybache Mar 3, 2023
2bae589
attempt 10
emilybache Mar 3, 2023
48d46cd
attempt 11
emilybache Mar 3, 2023
bc74d2b
first draft of documentation
emilybache Mar 9, 2023
15ed66a
make db connection flexible enough to also use pymysql
emilybache Mar 9, 2023
a48cd5a
make db connection use sqlite3 as a backup option
emilybache Mar 9, 2023
fff09f9
Open and Close database connection properly on each request
emilybache Mar 9, 2023
2bc36a5
improve the docs
emilybache Mar 9, 2023
5e0f743
First attempt to get it to work on a system where mysql isn't installed
emilybache Mar 9, 2023
cfd9bbb
improve docs
emilybache Mar 9, 2023
0fbfe8c
wait for the server to start rather than sleeping a fixed time
emilybache Mar 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
wait for the server to start rather than sleeping a fixed time
emilybache committed Mar 9, 2023

Verified

This commit was signed with the committer’s verified signature.
WenyXu Weny Xu
commit 0fbfe8c81819c5b395c5e3ad8aba5455c7fbff09
16 changes: 13 additions & 3 deletions python/test/test_prices.py
Original file line number Diff line number Diff line change
@@ -14,14 +14,24 @@ def server(port):
app.run(port=port)


def wait_for_server_to_start(server_url):
started = False
while not started:
try:
requests.get(server_url)
started = True
except Exception as e:
time.sleep(0.2)


@pytest.fixture(autouse=True, scope="session")
def lift_pass_pricing_app():
""" starts the lift pass pricing flask app running on localhost """
p = multiprocessing.Process(target=server, args=(TEST_PORT,))
p.start()
# we need to give it time to start - one second usually seems to be enough
time.sleep(1)
yield f"http://127.0.0.1:{TEST_PORT}"
server_url = f"http://127.0.0.1:{TEST_PORT}"
wait_for_server_to_start(server_url)
yield server_url
p.terminate()