Browse Source

Reformat files

pull/37/head
Dashie der otter 11 months ago
parent
commit
c3b22ac68b
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
4 changed files with 11 additions and 9 deletions
  1. 3
    1
      app.py
  2. 1
    1
      tests/conftest.py
  3. 5
    5
      tests/helpers.py
  4. 2
    2
      tests/test_utils.py

+ 3
- 1
app.py View File

@@ -305,7 +305,9 @@ def create_app(config_filename="config.py", app_name=None, register_blueprints=T
pass

@cron.command()
@click.option("--file", default=None, help="Local file to import instead of downloading", type=click.Path(exists=True))
@click.option(
"--file", default=None, help="Local file to import instead of downloading", type=click.Path(exists=True)
)
def update_dxcc_from_cty(file):
"""Update DXCC tables from cty.xml"""
print("-- STARTED on {0}".format(datetime.datetime.now()))

+ 1
- 1
tests/conftest.py View File

@@ -28,7 +28,7 @@ def app():
@pytest.yield_fixture(scope="session")
def db(app):
_db.drop_all()
#_db.engine.connect().execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";')
# _db.engine.connect().execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";')
_db.create_all()

seed_config(_db)

+ 5
- 5
tests/helpers.py View File

@@ -39,13 +39,13 @@ _contacts_reg = re.compile(r"/contacts/(\d+)/edit")


def get_contact_id(html, callsign):
soup = bs(html, 'html.parser')
table = soup.find('table', {'class': 'contacts-list'})
rows = table.findAll('tr')
soup = bs(html, "html.parser")
table = soup.find("table", {"class": "contacts-list"})
rows = table.findAll("tr")
row = next(t for t in rows if t.findAll(text=re.compile(callsign)))
href = row.findAll('a', href=re.compile('edit'))
href = row.findAll("a", href=re.compile("edit"))
assert len(href) > 0
href = href[0]['href']
href = href[0]["href"]
match = _contacts_reg.search(href)
assert match
assert len(match.groups()) >= 1

+ 2
- 2
tests/test_utils.py View File

@@ -9,8 +9,8 @@ def test_debug_testing(app):
I have no effing idea why.
See conftest.py:db() for more.
"""
assert not app.config['DEBUG']
assert app.config['TESTING']
assert not app.config["DEBUG"]
assert app.config["TESTING"]


def test_gen_random_str():

Loading…
Cancel
Save