99from ddt import data , ddt , unpack
1010
1111from basest .core import decode , encode
12+ from basest .exceptions import InvalidSymbolTableError
1213
1314
1415base64_alphabet = [
@@ -140,9 +141,9 @@ def test_encode_rejects_non_unique_symbol_tables(
140141 ):
141142 """
142143 When a non-unique input or output symbol table is passed to encode(),
143- ValueError should be raised.
144+ InvalidSymbolTableError should be raised.
144145 """
145- with self .assertRaises (ValueError ):
146+ with self .assertRaises (InvalidSymbolTableError ):
146147 encode (
147148 len (input_symbol_table ), input_symbol_table ,
148149 len (output_symbol_table ), output_symbol_table ,
@@ -156,9 +157,9 @@ def test_encode_rejects_output_symbol_table_containing_padding_symbol(
156157 ):
157158 """
158159 When the output symbol table passed to encode() contains the padding
159- symbol, ValueError should be raised.
160+ symbol, InvalidSymbolTableError should be raised.
160161 """
161- with self .assertRaises (ValueError ):
162+ with self .assertRaises (InvalidSymbolTableError ):
162163 encode (1 , ['a' ], 1 , ['b' ], 'b' , 1 , 1 , [])
163164
164165 @data (
@@ -175,9 +176,9 @@ def test_encode_rejects_none_used_in_symbol_tables_and_padding(
175176 ):
176177 """
177178 When any of the symbol tables or the padding symbol passed to encode()
178- are or contain None, ValueError should be raised.
179+ are or contain None, InvalidSymbolTableError should be raised.
179180 """
180- with self .assertRaises (ValueError ):
181+ with self .assertRaises (InvalidSymbolTableError ):
181182 encode (
182183 len (input_symbol_table ), input_symbol_table ,
183184 len (output_symbol_table ), output_symbol_table ,
@@ -294,9 +295,9 @@ def test_decode_rejects_non_unique_symbol_tables(
294295 ):
295296 """
296297 When a non-unique input or output symbol table is passed to decode(),
297- ValueError should be raised.
298+ InvalidSymbolTableError should be raised.
298299 """
299- with self .assertRaises (ValueError ):
300+ with self .assertRaises (InvalidSymbolTableError ):
300301 decode (
301302 len (input_symbol_table ), input_symbol_table ,
302303 padding_symbol ,
@@ -310,9 +311,9 @@ def test_decode_rejects_input_symbol_table_containing_padding_symbol(
310311 ):
311312 """
312313 When the input symbol table passed to decode() contains the padding
313- symbol, ValueError should be raised.
314+ symbol, InvalidSymbolTableError should be raised.
314315 """
315- with self .assertRaises (ValueError ):
316+ with self .assertRaises (InvalidSymbolTableError ):
316317 decode (1 , ['a' ], 'a' , 1 , ['b' ], 1 , 1 , [])
317318
318319 @data (
@@ -329,9 +330,9 @@ def test_decode_rejects_none_used_in_symbol_tables_and_padding(
329330 ):
330331 """
331332 When any of the symbol tables or the padding symbol passed to decode()
332- are or contain None, ValueError should be raised.
333+ are or contain None, InvalidSymbolTableError should be raised.
333334 """
334- with self .assertRaises (ValueError ):
335+ with self .assertRaises (InvalidSymbolTableError ):
335336 decode (
336337 len (input_symbol_table ), input_symbol_table ,
337338 padding_symbol ,
0 commit comments