WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 92fcefd

Browse files
committed
Changed base class. Removed unnecessary code.
1 parent 236e87d commit 92fcefd

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

integrations/server/test_fluview.py

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,16 @@
77
import mysql.connector
88

99
# first party
10-
from delphi.epidata.client.delphi_epidata import Epidata
10+
from delphi.epidata.common.delphi_test_base import DelphiTestBase
1111

1212

13-
class FluviewTests(unittest.TestCase):
13+
class FluviewTests(DelphiTestBase):
1414
"""Tests the `fluview` endpoint."""
1515

16-
@classmethod
17-
def setUpClass(cls):
18-
"""Perform one-time setup."""
19-
20-
# use the local instance of the Epidata API
21-
Epidata.BASE_URL = 'http://delphi_web_epidata/epidata'
22-
Epidata.auth = ('epidata', 'key')
23-
24-
def setUp(self):
16+
def localSetUp(self):
2517
"""Perform per-test setup."""
2618

27-
# connect to the `epidata` database and clear the `fluview` table
28-
cnx = mysql.connector.connect(
29-
user='user',
30-
password='pass',
31-
host='delphi_database_epidata',
32-
database='epidata')
33-
cur = cnx.cursor()
34-
cur.execute('truncate table fluview')
35-
cur.execute('delete from api_user')
36-
cur.execute('insert into api_user(api_key, email) values ("key", "email")')
37-
cnx.commit()
38-
cur.close()
39-
40-
# make connection and cursor available to test cases
41-
self.cnx = cnx
42-
self.cur = cnx.cursor()
43-
44-
def tearDown(self):
45-
"""Perform per-test teardown."""
46-
self.cur.close()
47-
self.cnx.close()
19+
self.truncate_tables_list = ["fluview"]
4820

4921
def test_round_trip(self):
5022
"""Make a simple round-trip with some sample data."""
@@ -62,7 +34,7 @@ def test_round_trip(self):
6234
self.cnx.commit()
6335

6436
# make the request
65-
response = Epidata.fluview('nat', 202020)
37+
response = self.epidata_client.fluview('nat', 202020)
6638

6739
# assert that the right data came back
6840
self.assertEqual(response, {

0 commit comments

Comments
 (0)