Skip to content

Commit 0ffe5cd

Browse files
Tests: Reactivate EDB connectivity tests that don't actually have to connect to EDB.
1 parent c803d8d commit 0ffe5cd

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

run_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
test_aggregated_pieces.IMPORTER_SUITE,
100100
test_indexed_piece.INDEXED_PIECE_SUITE_A,
101101
test_indexed_piece.INDEXED_PIECE_PARTS_TITLES,
102-
# test_indexed_piece.INDEXED_PIECE_SUITE_C,
102+
test_indexed_piece.INDEXED_PIECE_SUITE_C,
103103
test_aggregated_pieces.AGGREGATED_PIECES_SUITE,
104104
# NB: Most of these WorkflowManager tests pass but they are commented out because the WorkflowManager is deprecated.
105105
# # WorkflowManager

vis/tests/test_indexed_piece.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def test_part_ranges(self):
201201
expected_range = [('E4', 'E5'), ('E3', 'B4'), ('F#3', 'A4'), ('A2', 'C4')]
202202
actual_range = _find_part_ranges(score)
203203
self.assertEqual(expected_range, actual_range)
204-
'''
204+
205205
class TestIndexedPieceC(TestCase):
206206

207207
def test_meta(self):
@@ -210,21 +210,22 @@ def test_meta(self):
210210
ind = IndexedPiece(piece, metafile=meta)
211211
self.assertEqual('Sacred', ind.metadata('religiosity'))
212212

213-
def test_json(self):
214-
meta = 'http://database.elvisproject.ca/piece/1971/?format=json'
215-
username = 'mborsodi'
216-
password = 'lalalalala'
217-
piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
218-
ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
219-
self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))
220-
221-
def test_json2(self):
222-
meta = 'http://database.elvisproject.ca/piece/1971/'
223-
username = 'mborsodi'
224-
password = 'lalalalala'
225-
piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
226-
ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
227-
self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))
213+
# These two tests are turned off until we can test without having to link to the ELVIS Database.
214+
# def test_json(self):
215+
# meta = 'http://database.elvisproject.ca/piece/1971/?format=json'
216+
# username = 'mborsodi'
217+
# password = 'lalalalala'
218+
# piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
219+
# ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
220+
# self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))
221+
222+
# def test_json2(self):
223+
# meta = 'http://database.elvisproject.ca/piece/1971/'
224+
# username = 'mborsodi'
225+
# password = 'lalalalala'
226+
# piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
227+
# ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
228+
# self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))
228229

229230
def test_missing_usrn(self):
230231
meta = 'http://database.elvisproject.ca/piece/1971/'
@@ -241,11 +242,11 @@ def test_missing_pswrd(self):
241242
IndexedPiece(piece, metafile=meta, username='mborsodi')
242243
except RuntimeError as run_err:
243244
self.assertEqual(IndexedPiece._MISSING_PASSWORD, run_err.args[0])
244-
'''
245+
245246

246247
#-------------------------------------------------------------------------------------------------#
247248
# Definitions #
248249
#-------------------------------------------------------------------------------------------------#
249250
INDEXED_PIECE_SUITE_A = TestLoader().loadTestsFromTestCase(TestIndexedPieceA)
250251
INDEXED_PIECE_PARTS_TITLES = TestLoader().loadTestsFromTestCase(TestPartsAndTitles)
251-
#INDEXED_PIECE_SUITE_C = TestLoader().loadTestsFromTestCase(TestIndexedPieceC)
252+
INDEXED_PIECE_SUITE_C = TestLoader().loadTestsFromTestCase(TestIndexedPieceC)

0 commit comments

Comments
 (0)