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

59 behave tests improvement #65

Merged
merged 27 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f22e629
Create MockPurpleAirAPIHelpers.py
carlkidcrypto Nov 11, 2023
f0c1dac
Refactor & Tests
carlkidcrypto Nov 12, 2023
1705135
Update tests.yml
carlkidcrypto Nov 12, 2023
3afd9fc
tests.ym;
carlkidcrypto Nov 12, 2023
e223333
Update test_purpleair_data_logger_helpers.py
carlkidcrypto Nov 12, 2023
7ab16d7
Update test_purpleair_data_logger.py
carlkidcrypto Nov 12, 2023
77027ad
flatten_single_sensor_data
carlkidcrypto Nov 12, 2023
c6b83eb
Coverage
carlkidcrypto Nov 13, 2023
63e8475
test_flatten_single_sensor_data
carlkidcrypto Nov 13, 2023
b77c1fb
Tests
carlkidcrypto Nov 13, 2023
0c158f7
Refactor
carlkidcrypto Nov 13, 2023
333df67
Update test_purpleair_data_logger_helpers.py
carlkidcrypto Nov 13, 2023
73832f2
test_logic_for_storing_single_sensor_data
carlkidcrypto Nov 14, 2023
aad4a3f
test_logic_for_storing_multiple_sensors_data
carlkidcrypto Nov 14, 2023
0513cff
test_logic_for_storing_group_sensors_data
carlkidcrypto Nov 15, 2023
a6939fa
Update test_purpleair_data_logger_helpers.py
carlkidcrypto Nov 15, 2023
dbfe58c
Update test_purpleair_data_logger_helpers.py
carlkidcrypto Nov 15, 2023
9459edc
group sensors
carlkidcrypto Nov 15, 2023
2570cec
more coooovvvvveeeerraaage
carlkidcrypto Nov 15, 2023
618a91f
Update test_purpleair_data_logger_helpers.py
carlkidcrypto Nov 15, 2023
25787a5
black
carlkidcrypto Nov 15, 2023
242ad0a
local request logic
carlkidcrypto Nov 21, 2023
e2879ea
Local API
carlkidcrypto Nov 23, 2023
6b90f0d
Sphinx Docs
carlkidcrypto Nov 23, 2023
75084c7
- automating sphinx docs
carlkidcrypto Nov 23, 2023
2e9634f
- attempting to add upload of artifacts from sphinx docs
carlkidcrypto Nov 23, 2023
5001d5d
One more sphinx yml
carlkidcrypto Nov 23, 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
22 changes: 22 additions & 0 deletions .github/workflows/sphinx_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Pull Request Sphinx Docs Check"
on:
push:
branches: [ main ]

pull_request:
branches: [ main ]

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "sphinx_docs_build/"
build-command: "make html"

- uses: actions/upload-artifact@v3
with:
name: DocumentationHTML
path: docs/
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tests

on:
push:
branches: [ 59-behave-tests-improvement ]

pull_request:
branches: [ main ]

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Set up Python 3.10 env for running unittest tests...
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install python3 requirements...
uses: knicknic/[email protected]
with:
linux: cd /home/runner/work/purpleair_data_logger/purpleair_data_logger/ ;
python -m pip install --upgrade wheel ;
python -m pip install --upgrade setuptools ;
python -m pip install --upgrade pip ;
python -m pip install coverage ;
python -m pip install requests_mock ;
python -m pip install purpleair_api ;

- name: Run unit tests...
uses: knicknic/[email protected]
with:
linux: cd /home/runner/work/purpleair_data_logger/purpleair_data_logger/tests ;
coverage run -m unittest && coverage json ;

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Binary file modified docs/doctrees/PurpleAirCSVDataLogger.doctree
Binary file not shown.
Binary file modified docs/doctrees/PurpleAirCSVDataLoggerConstants.doctree
Binary file not shown.
Binary file modified docs/doctrees/PurpleAirDataLogger.doctree
Binary file not shown.
Binary file added docs/doctrees/PurpleAirDataLoggerHelpers.doctree
Binary file not shown.
Binary file modified docs/doctrees/PurpleAirPSQLDataLogger.doctree
Binary file not shown.
Binary file modified docs/doctrees/PurpleAirPSQLQueryStatements.doctree
Binary file not shown.
Binary file modified docs/doctrees/PurpleAirSQLiteDataLogger.doctree
Binary file not shown.
Binary file modified docs/doctrees/PurpleAirSQLiteQueryStatements.doctree
Binary file not shown.
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/doctrees/modules.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/html/.buildinfo
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: e1c1a450354c7c1036cccfed48563e0a
config: 8e8a1e6ee8ef18077e8ca108d99e283e
tags: 645f666f9bcd5a90fca523b33c5a78b7
19 changes: 10 additions & 9 deletions docs/html/PurpleAirCSVDataLogger.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PurpleAirCSVDataLogger module &mdash; PurpleAir Data Logger(s) V1.2.1 documentation</title>
<title>PurpleAirCSVDataLogger module &mdash; PurpleAir Data Logger(s) V1.3.0a1 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script src="_static/jquery.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=c3a4fe22"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
Expand Down Expand Up @@ -54,6 +54,7 @@
</li>
<li class="toctree-l2"><a class="reference internal" href="PurpleAirCSVDataLoggerConstants.html">PurpleAirCSVDataLoggerConstants module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PurpleAirDataLogger.html">PurpleAirDataLogger module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PurpleAirDataLoggerHelpers.html">PurpleAirDataLoggerHelpers module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PurpleAirPSQLDataLogger.html">PurpleAirPSQLDataLogger module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PurpleAirPSQLQueryStatements.html">PurpleAirPSQLQueryStatements module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PurpleAirSQLiteDataLogger.html">PurpleAirSQLiteDataLogger module</a></li>
Expand Down Expand Up @@ -88,7 +89,7 @@
<div itemprop="articleBody">

<section id="module-PurpleAirCSVDataLogger">
<span id="purpleaircsvdatalogger-module"></span><h1>PurpleAirCSVDataLogger module<a class="headerlink" href="#module-PurpleAirCSVDataLogger" title="Permalink to this heading"></a></h1>
<span id="purpleaircsvdatalogger-module"></span><h1>PurpleAirCSVDataLogger module<a class="headerlink" href="#module-PurpleAirCSVDataLogger" title="Link to this heading"></a></h1>
<p>Copyright 2023 carlkidcrypto, All rights reserved.
A python class designed to use the PurpleAirAPI for requesting sensor(s) data.
Data will be inserted into CSV files.</p>
Expand All @@ -100,12 +101,12 @@
single request rather than individual requests in succession.”</p>
<dl class="py class">
<dt class="sig sig-object py" id="PurpleAirCSVDataLogger.PurpleAirCSVDataLogger">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">PurpleAirCSVDataLogger.</span></span><span class="sig-name descname"><span class="pre">PurpleAirCSVDataLogger</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">PurpleAirAPIReadKey</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">PurpleAirAPIWriteKey</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path_to_save_csv_files_in</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PurpleAirCSVDataLogger.PurpleAirCSVDataLogger" title="Permalink to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">PurpleAirCSVDataLogger.</span></span><span class="sig-name descname"><span class="pre">PurpleAirCSVDataLogger</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">PurpleAirApiReadKey</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">PurpleAirApiWriteKey</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">PurpleAirApiIpv4Address</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">path_to_save_csv_files_in</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PurpleAirCSVDataLogger.PurpleAirCSVDataLogger" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">PurpleAirDataLogger</span></code></p>
<p>The logger class. For now we will insert data into a CSV file.</p>
<dl class="py method">
<dt class="sig sig-object py" id="PurpleAirCSVDataLogger.PurpleAirCSVDataLogger.store_sensor_data">
<span class="sig-name descname"><span class="pre">store_sensor_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">single_sensor_data_dict</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PurpleAirCSVDataLogger.PurpleAirCSVDataLogger.store_sensor_data" title="Permalink to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">store_sensor_data</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">single_sensor_data_dict</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#PurpleAirCSVDataLogger.PurpleAirCSVDataLogger.store_sensor_data" title="Link to this definition"></a></dt>
<dd><p>Insert the sensor data into CSV files.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand Down
Loading
Loading