Skip to content

Commit

Permalink
Tests: Reactivate EDB connectivity tests that don't actually have to …
Browse files Browse the repository at this point in the history
…connect to EDB.
  • Loading branch information
alexandermorgan committed Oct 10, 2016
1 parent c803d8d commit 0ffe5cd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
test_aggregated_pieces.IMPORTER_SUITE,
test_indexed_piece.INDEXED_PIECE_SUITE_A,
test_indexed_piece.INDEXED_PIECE_PARTS_TITLES,
# test_indexed_piece.INDEXED_PIECE_SUITE_C,
test_indexed_piece.INDEXED_PIECE_SUITE_C,
test_aggregated_pieces.AGGREGATED_PIECES_SUITE,
# NB: Most of these WorkflowManager tests pass but they are commented out because the WorkflowManager is deprecated.
# # WorkflowManager
Expand Down
37 changes: 19 additions & 18 deletions vis/tests/test_indexed_piece.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def test_part_ranges(self):
expected_range = [('E4', 'E5'), ('E3', 'B4'), ('F#3', 'A4'), ('A2', 'C4')]
actual_range = _find_part_ranges(score)
self.assertEqual(expected_range, actual_range)
'''

class TestIndexedPieceC(TestCase):

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

def test_json(self):
meta = 'http://database.elvisproject.ca/piece/1971/?format=json'
username = 'mborsodi'
password = 'lalalalala'
piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))
def test_json2(self):
meta = 'http://database.elvisproject.ca/piece/1971/'
username = 'mborsodi'
password = 'lalalalala'
piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))
# These two tests are turned off until we can test without having to link to the ELVIS Database.
# def test_json(self):
# meta = 'http://database.elvisproject.ca/piece/1971/?format=json'
# username = 'mborsodi'
# password = 'lalalalala'
# piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
# ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
# self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))

# def test_json2(self):
# meta = 'http://database.elvisproject.ca/piece/1971/'
# username = 'mborsodi'
# password = 'lalalalala'
# piece = os.path.join(VIS_PATH, 'tests', 'corpus', 'Missa-Fortuna-desperata_Kyrie_Josquin-Des-Prez_file6.xml')
# ind = IndexedPiece(piece, metafile=meta, username=username, password=password)
# self.assertEqual('Missa Fortuna desperata', ind.metadata('title'))

def test_missing_usrn(self):
meta = 'http://database.elvisproject.ca/piece/1971/'
Expand All @@ -241,11 +242,11 @@ def test_missing_pswrd(self):
IndexedPiece(piece, metafile=meta, username='mborsodi')
except RuntimeError as run_err:
self.assertEqual(IndexedPiece._MISSING_PASSWORD, run_err.args[0])
'''


#-------------------------------------------------------------------------------------------------#
# Definitions #
#-------------------------------------------------------------------------------------------------#
INDEXED_PIECE_SUITE_A = TestLoader().loadTestsFromTestCase(TestIndexedPieceA)
INDEXED_PIECE_PARTS_TITLES = TestLoader().loadTestsFromTestCase(TestPartsAndTitles)
#INDEXED_PIECE_SUITE_C = TestLoader().loadTestsFromTestCase(TestIndexedPieceC)
INDEXED_PIECE_SUITE_C = TestLoader().loadTestsFromTestCase(TestIndexedPieceC)

0 comments on commit 0ffe5cd

Please sign in to comment.