File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1616
1717empty_file_error = "Please provide a file containing a corpus \(not an empty file\)."
1818binary_file_error = "Please provide a file containing text-based data."
19- nonnegative_integer_error = "Please enter a non-negative integer for the number of samples desired\: "
19+ negative_integer_error = "Please enter a non-negative integer for the number of samples desired. size= "
2020
2121
2222class TestValidation (unittest .TestCase ):
@@ -49,15 +49,15 @@ def test_negative_integer(self):
4949 words = vose_sampler .get_words (valid_folder + "small.txt" )
5050 word_dist = vose_sampler .sample2dist (words )
5151 VA_words = vose_sampler .VoseAlias (word_dist )
52- self .assertRaisesRegex (ValueError , nonnegative_integer_error + "-1" , VA_words .sample_n , - 1 )
52+ self .assertRaisesRegex (ValueError , negative_integer_error + "-1" , VA_words .sample_n , - 1 )
5353
5454 def test_zero_integer (self ):
5555 """Test vose_sampler.ProbDistribution.alias_generation against a size
5656 defined by zero. """
5757 words = vose_sampler .get_words (valid_folder + "small.txt" )
5858 word_dist = vose_sampler .sample2dist (words )
5959 VA_words = vose_sampler .VoseAlias (word_dist )
60- self .assertRaisesRegex ( ValueError , nonnegative_integer_error + "0" , VA_words .sample_n , 0 )
60+ self .assertEqual ([], VA_words .sample_n ( size = 0 ) )
6161
6262
6363class TestAccuracy (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments