Пример #1
0
    def test_generate_consonant_if_output_in_original_list(self):
        """Test generate_consonant function if the output is in the original list.

        The result is expected True
        """
        consonants = [
            'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q',
            'r', 's', 't', 'v', 'w', 'x', 'y', 'z'
        ]
        self.assertTrue(dungeonsanddragons.generate_consonant() in consonants)
Пример #2
0
    def test_generate_consonant_type(self):
        """Test generate_consonant function if the type of output is string.

        The result is expected True
        """
        self.assertTrue(type(dungeonsanddragons.generate_consonant()) == str)
Пример #3
0
    def test_generate_consonant_length(self):
        """Test generate_consonant function if the length of output is 1.

        The result is expected 1
        """
        self.assertEqual(len(dungeonsanddragons.generate_consonant()), 1)
Пример #4
0
 def test_generate_consonant(self):
     consonant = ['b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'z']
     actual_value = generate_consonant()
     self.assertTrue(actual_value in consonant)
Пример #5
0
 def test_generate_consonant_min(self, mock_randint):
     actual = generate_consonant()
     expected = 'b'
     self.assertEqual(expected, actual)
Пример #6
0
 def test_generate_consonant1(self):
     self.assertEqual(1, len(dungeonsanddragons.generate_consonant()))   # Tests that output has a length of one
Пример #7
0
 def test_generate_consonant(self):
     self.assertEqual(str, type(dungeonsanddragons.generate_consonant()))  # Tests that output is of type string
Пример #8
0
 def test_generate_consonant2(self):
     random.seed(4)
     self.assertEqual('K', dungeonsanddragons.generate_consonant())  # Tests fixed random output
     random.seed()