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

Created test for dashboard. #105

Merged
merged 1 commit into from
Feb 7, 2025
Merged

Conversation

CheatCodeSam
Copy link
Contributor

Few changes here. I got the tests to spawn an sqlite database and test against that. Depending on if the app is running in pytest or not, it's going to use .env or .env.testing. So we can run test in one database and dev/prod in another. I've also added pytest-mock so we can snub out some of the repository checks.

The each individual test is automatically going to migrate the database on startup and drop it on shutdown. I've been running it against "testing.db" and I haven't had any issues with it.

I think this is a good place to go to start really testing this thing. I'd rather not mock out as much as we can.

@jberkus
Copy link
Member

jberkus commented Feb 7, 2025

Looks good, merging.

Please pull a change from Main, though; I fixed the Raise statement in config.py.

@jberkus jberkus merged commit 7283ff3 into elekto-io:main Feb 7, 2025
@jberkus
Copy link
Member

jberkus commented Feb 7, 2025

Also: maybe we should supply an .env.testing? I don't see any good reason to have that be user-generated.

@CheatCodeSam
Copy link
Contributor Author

@jberkus
That sounds like a great idea, I'll add one to my next PR. I'm thinking of tackling that lowercase issue next. #99

@jberkus
Copy link
Member

jberkus commented Feb 17, 2025

That would def be the highest-priority one. The problem is that we need to test almost every path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants