コード例 #1
0
ファイル: test_download.py プロジェクト: spirillen/PyFunceble
    def test_set_url_return(self) -> None:
        """
        Tests the response of the method which let us set the url to work with.
        """

        given = "https://example.org"
        download_helper = DownloadHelper()

        actual = download_helper.set_url(given)

        self.assertIsInstance(actual, DownloadHelper)
コード例 #2
0
ファイル: test_download.py プロジェクト: spirillen/PyFunceble
    def test_set_url_not_str(self) -> None:
        """
        Tests the method which let us set the url to work with for the case that
        the given url is not a string.
        """

        given = ["Hello", "World"]

        download_helper = DownloadHelper()

        self.assertRaises(TypeError, lambda: download_helper.set_url(given))
コード例 #3
0
ファイル: test_download.py プロジェクト: spirillen/PyFunceble
    def test_set_url(self) -> None:
        """
        Tests the method which let us set the url to work with.
        """

        given = "https://example.org"

        expected = "https://example.org"
        download_helper = DownloadHelper()

        download_helper.set_url(given)

        actual = download_helper.url

        self.assertEqual(expected, actual)

        download_helper = DownloadHelper(given)

        actual = download_helper.url

        self.assertEqual(expected, actual)