-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Docs and Prints - removed stray print statements - fixed type in documentation - starting to prep for the V1.1.1 release * Testing - added some basic tests to the write api. * Docs - even more doc updates. added some UML - updated the main readme * sphinx - updated the sphinx docs
- Loading branch information
1 parent
7ed3004
commit 5522c0b
Showing
26 changed files
with
92 additions
and
20 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Diagrams | ||
|
||
This directory contains design diagrams. | ||
|
||
## Auto Generate UML | ||
|
||
```bash | ||
pyreverse -d . -o png ../purpleair_api | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 0e3dd2b003b323d457484d3d023fbd15 | ||
config: 0e51ed3cfc03ba99e6a14e4a6722ae86 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
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
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
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
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
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
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
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
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
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
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Copyright 2023 carlkidcrypto, All rights reserved. | ||
""" | ||
|
||
|
||
import unittest | ||
import requests_mock | ||
import sys | ||
|
||
sys.path.append("../") | ||
|
||
from purpleair_api.PurpleAirWriteAPI import PurpleAirWriteAPI | ||
|
||
|
||
class PurpleAirWriteAPITest(unittest.TestCase): | ||
def setUp(self): | ||
self.pala = PurpleAirWriteAPI(123456789) | ||
|
||
def tearDown(self): | ||
self.pala = None | ||
|
||
def test_post_create_group_data(self): | ||
""" | ||
Test that we can post to create a group for sensors. | ||
""" | ||
|
||
# Setup | ||
fake_url_request = "https://api.purpleair.com/v1/groups" | ||
|
||
# Action and Expected Result | ||
with requests_mock.Mocker() as m: | ||
m.post( | ||
fake_url_request, | ||
text='{"test" : 1234}', | ||
status_code=200, | ||
) | ||
self.pala.post_create_group_data("this_is_a_name") | ||
|
||
def test_post_create_member_with_sensor_index(self): | ||
""" | ||
Test that we can post to add members to a sensor group. | ||
""" | ||
|
||
# Setup | ||
fake_url_request = "https://api.purpleair.com/v1/groups/1234/members" | ||
|
||
# Action and Expected Result | ||
with requests_mock.Mocker() as m: | ||
m.post( | ||
fake_url_request, | ||
text='{"test" : 1234}', | ||
status_code=200, | ||
) | ||
self.pala.post_create_member(group_id=1234, sensor_index=4567) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |