コード例 #1
0
    def test_wrong_type(self):
        """
        Tests for the case that the wrong type is given.
        """

        self.assertRaises(
            PyFunceble.exceptions.WrongParameterType,
            lambda: Month(["January"]).get_converted(),
        )

        self.assertRaises(PyFunceble.exceptions.WrongParameterType,
                          lambda: Month(1).get_converted())
コード例 #2
0
    def test_february(self):
        """
        Tests for the case that we given a representation of the February month.
        """

        given = ["feb", "Feb", "February", "02", "2", "Feb.", "feb."]
        expected = "feb"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #3
0
    def test_january(self):
        """
        Tests for the case that we given a representation of the January month.
        """

        given = ["jan", "Jan", "January", "01", "1", "Jan.", "jan."]
        expected = "jan"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #4
0
    def test_november(self):
        """
        Tests for the case that we given a representation of the November month.
        """

        given = ["nov", "Nov", "November", "11", "Nov.", "nov."]
        expected = "nov"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #5
0
    def test_december(self):
        """
        Tests for the case that we given a representation of the December month.
        """

        given = ["dec", "Dec", "December", "12", "Dec.", "dec."]
        expected = "dec"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #6
0
    def test_august(self):
        """
        Tests for the case that we given a representation of the August month.
        """

        given = ["aug", "Aug", "August", "08", "8", "Aug.", "aug."]
        expected = "aug"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #7
0
    def test_october(self):
        """
        Tests for the case that we given a representation of the October month.
        """

        given = ["oct", "Oct", "October", "10", "Oct.", "oct."]
        expected = "oct"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #8
0
    def test_july(self):
        """
        Tests for the case that we given a representation of the July month.
        """

        given = ["jul", "Jul", "July", "07", "7", "Jul.", "jul."]
        expected = "jul"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #9
0
    def test_may(self):
        """
        Tests for the case that we given a representation of the May month.
        """

        given = ["may", "May", "05", "5"]
        expected = "may"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #10
0
    def test_april(self):
        """
        Tests for the case that we given a representation of the April month.
        """

        given = ["apr", "Apr", "April", "04", "4", "Apr.", "apr."]
        expected = "apr"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #11
0
    def test_march(self):
        """
        Tests for the case that we given a representation of the March month.
        """

        given = ["mar", "Mar", "March", "03", "3", "Mar.", "mar."]
        expected = "mar"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)
コード例 #12
0
    def test_september(self):
        """
        Tests for the case that we given a representation of the September month.
        """

        given = [
            "sep",
            "Sep",
            "sept",
            "Sept",
            "September",
            "09",
            "9",
            "Sept.",
            "sept.",
            "Sep.",
            "sep.",
        ]
        expected = "sep"

        for data in given:
            actual = Month(data).get_converted()

            self.assertEqual(expected, actual, data)