Exemplo n.º 1
0
    def test_tor_browser_with_http_proxy(self, config, http_proxy):
        tor_browser = TorBrowser(
            config=config,
            url=self.target_url,
            proxy=http_proxy,
            use_proxy_type="http",
            explicit_wait_duration=0,
        )

        tor_browser.setup()
        tor_browser.connect()
        tor_browser.fetch()

        assert http_proxy[0] in tor_browser.page_source

        tor_browser.close()
Exemplo n.º 2
0
    def test_tor_browser_security_level_safer(self, config, tor_proxy):
        tor_browser = TorBrowser(
            config=config,
            url=self.target_url,
            proxy=tor_proxy,
            use_proxy_type="tor",
            explicit_wait_duration=0,
            options={"tbb_security_level": "safer"},
        )

        tor_browser.setup()
        tor_browser.connect()
        tor_browser.fetch()

        assert (
            "Congratulations. This browser is configured to use Tor."
            in tor_browser.page_source
        )

        tor_browser.close()