Skip to content

Commit

Permalink
update tests to pass ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
drkane committed Oct 12, 2023
1 parent 3c207d3 commit 209edf1
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.10.9
python-3.10.13
2 changes: 0 additions & 2 deletions tests/blueprints/test_areas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import html

from tests.fixtures import client

AREA_CODE = "S02000783"
AREA_NAME = "Lower Bow & Larkfield, Fancy Farm, Mallard Bowl"
Expand Down
1 change: 0 additions & 1 deletion tests/blueprints/test_areatypes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import html

from tests.fixtures import client

AREATYPE_CODE = "lsoa11"

Expand Down
9 changes: 6 additions & 3 deletions tests/blueprints/test_extend.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import json
from urllib.parse import urlencode

from tests.fixtures import client


def test_reconcile_spec(client):
rv = client.get("/reconcile")
Expand All @@ -15,7 +13,12 @@ def test_reconcile_spec(client):
# assert isinstance(spec.get("extend", {}).get("property_settings"), list)
# assert "name" in spec.get("extend", {}).get("property_settings", [])[0]
# assert "label" in spec.get("extend", {}).get("property_settings", [])[0]
# assert spec.get("extend", {}).get("property_settings", [])[0]["type"] in ["number", "text", "checkbox", "select"]
# assert spec.get(
# "extend", {}
# ).get(
# "property_settings",
# []
# )[0]["type"] in ["number", "text", "checkbox", "select"]


# def test_reconcile_properties(client):
Expand Down
1 change: 0 additions & 1 deletion tests/blueprints/test_index.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tests.fixtures import client


def test_index(client):
Expand Down
1 change: 0 additions & 1 deletion tests/blueprints/test_points.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tests.fixtures import client


def test_point_json(client):
Expand Down
1 change: 0 additions & 1 deletion tests/blueprints/test_postcodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tests.fixtures import client


def test_postcode_json(client):
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures.py → tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import io
import json
import os
from contextlib import contextmanager
Expand Down
3 changes: 1 addition & 2 deletions tests/controllers/test_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from findthatpostcode.controllers.controller import Controller
from tests.fixtures import MockElasticsearch
from tests.conftest import MockElasticsearch


def test_controller_class():
Expand Down Expand Up @@ -27,7 +27,6 @@ def test_controller_class():


def test_controller_fetch():

es = MockElasticsearch()

a = Controller.get_from_es(
Expand Down
2 changes: 1 addition & 1 deletion tests/controllers/test_controller_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from findthatpostcode.controllers.areas import Area, get_all_areas, search_areas
from findthatpostcode.controllers.postcodes import Postcode
from tests.fixtures import MockElasticsearch
from tests.conftest import MockElasticsearch


def test_area_class():
Expand Down
3 changes: 1 addition & 2 deletions tests/controllers/test_controller_point.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from findthatpostcode.controllers.points import Point
from tests.fixtures import MockElasticsearch
from tests.conftest import MockElasticsearch


def test_point_class():
Expand All @@ -10,7 +10,6 @@ def test_point_class():


def test_point_class_es():

es = MockElasticsearch()
a = Point.get_from_es((100, -100), es)

Expand Down
3 changes: 1 addition & 2 deletions tests/controllers/test_controller_postcodes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from findthatpostcode.controllers.postcodes import Postcode
from tests.fixtures import MockElasticsearch
from tests.conftest import MockElasticsearch


def test_postcode_class():
Expand All @@ -10,7 +10,6 @@ def test_postcode_class():


def test_postcode_class_es():

es = MockElasticsearch()
a = Postcode.get_from_es("EX36 4AT", es)

Expand Down

0 comments on commit 209edf1

Please sign in to comment.