From 865dd500273c3824547732c26de19f1c6c7cb799 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 14 Aug 2021 07:47:19 -0700 Subject: [PATCH] rename (#2) * rename * Update tox.ini * update tests --- {openei => openeihttp}/__init__.py | 0 {openei => openeihttp}/const.py | 0 tests/conftest.py | 6 +++--- tests/test_init.py | 14 +++++++------- tox.ini | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) rename {openei => openeihttp}/__init__.py (100%) rename {openei => openeihttp}/const.py (100%) diff --git a/openei/__init__.py b/openeihttp/__init__.py similarity index 100% rename from openei/__init__.py rename to openeihttp/__init__.py diff --git a/openei/const.py b/openeihttp/const.py similarity index 100% rename from openei/const.py rename to openeihttp/const.py diff --git a/tests/conftest.py b/tests/conftest.py index e3ffde3..551dc0b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,20 +2,20 @@ import pytest import json -import openei +import openeihttp from tests.common import load_fixture @pytest.fixture(name="test_lookup") def test_lookup(): """Load the charger data.""" - return openei.Rates(api="fakeAPIKey", lat="1", lon="1") + return openeihttp.Rates(api="fakeAPIKey", lat="1", lon="1") @pytest.fixture(name="test_rates") def test_rates(): """Load the charger data.""" - return openei.Rates( + return openeihttp.Rates( api="fakeAPIKey", lat="1", lon="1", plan="574613aa5457a3557e906f5b" ) diff --git a/tests/test_init.py b/tests/test_init.py index e59363c..e4d64c4 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -3,7 +3,7 @@ from datetime import time from freezegun import freeze_time import pytest -import openei +import openeihttp def test_get_lookup_data(test_lookup, lookup_mock): @@ -187,31 +187,31 @@ def test_get_name(test_rates, plandata_mock): def test_get_lookup_data_404(test_lookup, lookup_mock_404): """Test lookup error 404""" - with pytest.raises(openei.UrlNotFound): + with pytest.raises(openeihttp.UrlNotFound): test_lookup.lookup_plans() def test_get_lookup_data_401(test_lookup, lookup_mock_401): """Test lookup error 401""" - with pytest.raises(openei.NotAuthorized): + with pytest.raises(openeihttp.NotAuthorized): test_lookup.lookup_plans() def test_get_plan_data_404(test_rates, plandata_mock_404): """Test rate schedules.""" - with pytest.raises(openei.UrlNotFound): + with pytest.raises(openeihttp.UrlNotFound): test_rates.update() def test_get_plan_data_401(test_rates, plandata_mock_401): """Test rate schedules.""" - with pytest.raises(openei.NotAuthorized): + with pytest.raises(openeihttp.NotAuthorized): test_rates.update() def test_get_plan_data_api_err(test_rates, plandata_mock_api_err, caplog): """Test rate schedules.""" - with pytest.raises(openei.APIError): + with pytest.raises(openeihttp.APIError): test_rates.update() assert ( "No api_key was supplied. Get one at https://api.openei.org:443" @@ -221,7 +221,7 @@ def test_get_plan_data_api_err(test_rates, plandata_mock_api_err, caplog): def test_get_lookup_data_api_err(test_lookup, lookup_mock_api_err, caplog): """Test rate schedules.""" - with pytest.raises(openei.APIError): + with pytest.raises(openeihttp.APIError): test_lookup.lookup_plans() assert ( "No api_key was supplied. Get one at https://api.openei.org:443" diff --git a/tox.ini b/tox.ini index 46d2795..a7e39d3 100644 --- a/tox.ini +++ b/tox.ini @@ -18,9 +18,9 @@ basepython = python3 ignore_errors = True commands = black --check ./ - flake8 openei - pylint openei - pydocstyle openei tests + flake8 openeihttp + pylint openeihttp + pydocstyle openeihttp tests deps = -rrequirements_lint.txt -rrequirements_test.txt @@ -29,6 +29,6 @@ deps = basepython = python3 ignore_errors = True commands = - mypy openei + mypy openeihttp deps = -rrequirements_lint.txt \ No newline at end of file