Example #1
0
    def test_set_certificate_validation(self) -> None:
        """
        Tests the method which let us authorize the certificate validation.
        """

        given = True

        expected = True
        download_helper = DownloadHelper()

        download_helper.set_certificate_validation(given)

        actual = download_helper.certificate_validation

        self.assertEqual(expected, actual)

        download_helper = DownloadHelper(certificate_validation=given)

        actual = download_helper.certificate_validation

        self.assertEqual(expected, actual)
Example #2
0
    def test_set_certificate_validation_return(self) -> None:
        """
        Tests the response of the method which let us authorize the certificate
        validation.
        """

        given = True
        download_helper = DownloadHelper()

        actual = download_helper.set_certificate_validation(given)

        self.assertIsInstance(actual, DownloadHelper)
Example #3
0
    def test_set_certificate_validation_not_bool(self) -> None:
        """
        Tests the method which let us authorize the certificate validation for
        the case that the given value is not a boolean.
        """

        given = ["Hello", "World"]

        download_helper = DownloadHelper()

        self.assertRaises(
            TypeError,
            lambda: download_helper.set_certificate_validation(given))