예제 #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()