Esempio n. 1
0
    def test_wrong_type(self):
        """
        Tests for the case that the wrong type is given.
        """

        self.assertRaises(
            PyFunceble.exceptions.WrongParameterType,
            lambda: Digit2Digits(["1"]).get_converted(),
        )

        self.assertRaises(
            PyFunceble.exceptions.WrongParameterType,
            lambda: Digit2Digits(1).get_converted(),
        )
Esempio n. 2
0
    def test_more_than_two_digits(self):
        """
        Tests of the class for the case that we already have more than 2 digits.
        """

        expected = "211"
        actual = Digit2Digits("211").get_converted()

        self.assertEqual(expected, actual)
Esempio n. 3
0
    def test_simple_input(self):
        """
        Tests of the class.
        """

        expected = "01"
        actual = Digit2Digits("1").get_converted()

        self.assertEqual(expected, actual)