Skip to content

Commit

Permalink
rename (#2)
Browse files Browse the repository at this point in the history
* rename

* Update tox.ini

* update tests
  • Loading branch information
firstof9 authored Aug 14, 2021
1 parent fa85ef6 commit 865dd50
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
14 changes: 7 additions & 7 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,6 +29,6 @@ deps =
basepython = python3
ignore_errors = True
commands =
mypy openei
mypy openeihttp
deps =
-rrequirements_lint.txt

0 comments on commit 865dd50

Please sign in to comment.