def test_input_range_one_to_ten_outputs_correctly(self): expected = [ 1, 2, THREE_STR, 4, FIVE_STR, THREE_STR, 7, 8, THREE_STR, FIVE_STR, ] result = list(three_five_generator(lower=1, upper=11)) self.assertEqual(expected, result)
def test_input_range_ten_to_twenty_outputs_correctly(self): expected = [ FIVE_STR, 11, THREE_STR, 13, 14, THREE_FIVE_STR, 16, 17, THREE_STR, 19, FIVE_STR, ] result = list(three_five_generator(lower=10, upper=21)) self.assertEqual(expected, result)
def test_range_one_to_one_hundred_returns_correctly_amount_of_threefives( self): expected = 6 result = Counter(three_five_generator()).get(THREE_FIVE_STR) self.assertEqual(expected, result)
def test_input_1_outputs_1(self): expected = [1] result = list(three_five_generator(lower=1, upper=2)) self.assertEqual(expected, result)
def test_input_5_outputs_five(self): expected = [FIVE_STR] result = list(three_five_generator(lower=5, upper=6)) self.assertEqual(expected, result)
def test_input_lower_equals_to_upper_outputs_empty(self): expected = [] result = list(three_five_generator(lower=10, upper=10)) self.assertEqual(expected, result)
def test_input_both_floats_outputs_empty(self): expected = [] result = list(three_five_generator(lower=float(3), upper=float(4))) self.assertEqual(expected, result)
def test_input_str_4_outputs_empty(self): expected = [] result = list(three_five_generator(lower=3, upper="4")) self.assertEqual(expected, result)
def test_input_3_outputs_three(self): expected = [THREE_STR] result = list(three_five_generator(lower=3, upper=4)) self.assertEqual(expected, result)