Exemplo n.º 1
0
    def test_get_tb_bin_path(self):
        ver_str = "2.3.25-16"
        tb_bin_path_v2_3_25_16 = cm.get_tb_bin_path(ver_str)
        self.assert_(ver_str in tb_bin_path_v2_3_25_16)
        self.assert_(join('App', 'Firefox', 'firefox') in
                     tb_bin_path_v2_3_25_16)

        tb_bin_path_v3_5 = cm.get_tb_bin_path(cm.TBB_V_3_5)
        self.assert_(cm.TBB_V_3_5 in tb_bin_path_v3_5)
        self.assert_(join('Browser', 'firefox') in tb_bin_path_v3_5)

        tb_bin_path_V_4_0_8 = cm.get_tb_bin_path(cm.TBB_V_4_0_8)
        self.assert_(cm.TBB_V_4_0_8 in tb_bin_path_V_4_0_8)
        self.assert_(join('Browser', 'firefox') in tb_bin_path_V_4_0_8)

        self.assert_(cm.TBB_BASE_DIR in tb_bin_path_v2_3_25_16)
        self.assert_(cm.TBB_BASE_DIR in tb_bin_path_v3_5)
        self.assert_(cm.TBB_BASE_DIR in tb_bin_path_V_4_0_8)
    def test_get_tb_bin_path(self):
        ver_str = "2.3.25-16"
        tb_bin_path_v2_3_25_16 = cm.get_tb_bin_path(ver_str)
        self.assert_(ver_str in tb_bin_path_v2_3_25_16)
        self.assert_(
            join('App', 'Firefox', 'firefox') in tb_bin_path_v2_3_25_16)

        tb_bin_path_v3_5 = cm.get_tb_bin_path(cm.TBB_V_3_5)
        self.assert_(cm.TBB_V_3_5 in tb_bin_path_v3_5)
        self.assert_(join('Browser', 'firefox') in tb_bin_path_v3_5)

        tb_bin_path_V_4_0_8 = cm.get_tb_bin_path(cm.TBB_V_4_0_8)
        self.assert_(cm.TBB_V_4_0_8 in tb_bin_path_V_4_0_8)
        self.assert_(join('Browser', 'firefox') in tb_bin_path_V_4_0_8)

        self.assert_(cm.TBB_BASE_DIR in tb_bin_path_v2_3_25_16)
        self.assert_(cm.TBB_BASE_DIR in tb_bin_path_v3_5)
        self.assert_(cm.TBB_BASE_DIR in tb_bin_path_V_4_0_8)
    def get_tbb_binary(self, tbb_version, binary=None, logfile=None):
        """Return FirefoxBinary pointing to the TBB's firefox binary."""
        tbb_logfile = None
        if not binary:
            binary = cm.get_tb_bin_path(tbb_version)
        if logfile:
            tbb_logfile = open(logfile, 'a+')

        # in case you get an error for the unknown log_file, make sure your
        # Selenium version is compatible with the Firefox version in TBB.
        tbb_binary = FirefoxBinary(firefox_path=binary, log_file=tbb_logfile)
        return tbb_binary
Exemplo n.º 4
0
 def test_tb_bin_path(self):
     tb_bin_path = cm.get_tb_bin_path(version=get_recommended_tbb_version())
     self.assertTrue(os.path.isfile(tb_bin_path),
                     'Cannot find Tor Browser binary path %s'
                     % tb_bin_path)
Exemplo n.º 5
0
 def test_tb_bin_path(self):
     tb_bin_path = cm.get_tb_bin_path(version=cm.TBB_DEFAULT_VERSION)
     self.assertTrue(os.path.isfile(tb_bin_path),
                     'Cannot find Tor Browser binary path %s'
                     % tb_bin_path)