Skip to content

Commit

Permalink
add tests to test_transcriber that test whether NotImplementedError i…
Browse files Browse the repository at this point in the history
…s raised appropriately
  • Loading branch information
NickleDave committed Dec 31, 2018
1 parent 862c601 commit c02a82e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_transcriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,38 @@ def test_extra_keys_in_config_raises(self):
with self.assertRaises(KeyError):
crowsetta.Transcriber(user_config=user_config)

def test_call_to_csv_when_None_raises(self):
user_config = {
'example': {
'module': str(self.example_script_dir.joinpath('example.py')),
'to_seq': 'example2seq',
'to_csv': None,
'to_format': None,
}
}
scribe = crowsetta.Transcriber(user_config=user_config)
annotation = os.path.join(self.test_data_dir,
'example_user_format',
'bird1_annotation.mat')
with self.assertRaises(NotImplementedError):
scribe.to_csv(file=annotation, file_format='example')

def test_call_to_format_when_None_raises(self):
user_config = {
'example': {
'module': str(self.example_script_dir.joinpath('example.py')),
'to_seq': 'example2seq',
'to_csv': None,
'to_format': None,
}
}
scribe = crowsetta.Transcriber(user_config=user_config)
annotation = os.path.join(self.test_data_dir,
'example_user_format',
'bird1_annotation.mat')
with self.assertRaises(NotImplementedError):
scribe.to_format(file=annotation, to_format='example')

def test_from_csv(self):
csv_filename = os.path.join(self.test_data_dir,
os.path.normpath('csv/gy6or6_032312.csv'))
Expand Down

0 comments on commit c02a82e

Please sign in to comment.