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

Max mohammadi #68

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Max mohammadi #68

wants to merge 5 commits into from

Conversation

MaxMohammadi
Copy link
Collaborator

What's New?

Scraped RasperryPiLogs are saved in the database with the save_rpi_logs() function in database_wrapper.py.

Fixes #60

Type of change (pick-one)

  • Bug fix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist (check-all-before-merge)

formatting help: - [x] means "checked' and - [ ] means "unchecked"

  • I documented my code according to the Google Python Style Guide

  • I ran ./build_docs.sh and the docs look fine

  • I ran ./type_check.sh and got no errors

  • I ran ./format.sh because it automatically cleans my code for me 😄

  • I ran ./lint.sh to check for what "format" missed

  • I added my tests to the /tests directory

  • I ran ./run_tests.sh and all the tests pass

@mfekadu mfekadu self-requested a review February 25, 2020 21:48
Copy link
Member

@mfekadu mfekadu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks very good @MaxMohammadi !!
Thank for your contribution

My only request is that you test the code by running the following within __main__

# setup test
db = NimbusMySQLAlchemy()
db._create_all_tables()
data = {
# insert example input keys and values
}
db.save_rpi_logs(data)

# do the test
FOO = db.get_property_from_entity(
    prop="input_question", # you could do whatever Column name you care about
    entity=db.RPILogs,
    entity_string="whatever value you put for input_question in data"
)

assert FOO == ['whatever value']

Then commit your tested code or include a screenshot here

NOTE: if you run the above test multiple times then the assertion will fail because on the second try you will have save_rpi_logs twice

Feel free to come up with your own test

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.

Create API endpoint to store RaspberryPiLogs
2 participants