Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(70)  |  Call(70)  |  Derive(0)  |  Import(0)

src/s/a/sahara-2014.1/sahara/tests/unit/conductor/base.py   sahara(Download)
    def tearDown(self):
        for idx, check in enumerate(self._checks):
            check_val = check()
            self.assertEqual(self._results[idx], check_val,
                             msg="Check '%s' failed" % idx)

src/s/a/sahara-HEAD/sahara/tests/unit/conductor/base.py   sahara(Download)
    def tearDown(self):
        for idx, check in enumerate(self._checks):
            check_val = check()
            self.assertEqual(self._results[idx], check_val,
                             msg="Check '%s' failed" % idx)

src/s/a/sahara-2014.1/sahara/tests/unit/plugins/vanilla/v1_2_1/test_plugin.py   sahara(Download)
 
        self.assertEqual(
            c_h.get_config_value('HDFS', 'fs.default.name', cluster),
            'hdfs://inst1:8020')
        self.assertEqual(
            c_h.get_config_value('HDFS', 'spam', cluster), 'eggs')
        self.assertEqual(
            c_h.get_config_value('HDFS', 'dfs.safemode.extension'), 30000)
        (private_key2, public_key2) = c_h.get_hadoop_ssh_keys(cluster1)
 
        self.assertEqual(public_key1, public_key2)
        self.assertEqual(private_key1, private_key2)
 

src/s/a/sahara-HEAD/sahara/tests/unit/plugins/vanilla/v1_2_1/test_plugin.py   sahara(Download)
 
        self.assertEqual(
            c_h.get_config_value('HDFS', 'fs.default.name', cluster),
            'hdfs://inst1:8020')
        self.assertEqual(
            c_h.get_config_value('HDFS', 'spam', cluster), 'eggs')
        self.assertEqual(
            c_h.get_config_value('HDFS', 'dfs.safemode.extension'), 30000)
        (private_key2, public_key2) = c_h.get_hadoop_ssh_keys(cluster1)
 
        self.assertEqual(public_key1, public_key2)
        self.assertEqual(private_key1, private_key2)
 

src/s/a/sahara-2014.1/sahara/tests/unit/service/edp/test_job_manager.py   sahara(Download)
        res = job_manager.upload_job_files(mock.Mock(), 'job_prefix',
                                           job, 'hadoop')
        self.assertEqual(['job_prefix/script.pig'], res)
 
        job, _ = _create_all_stack('MapReduce')
        res = job_manager.upload_job_files(mock.Mock(), 'job_prefix',
                                           job, 'hadoop')
        self.assertEqual(['job_prefix/lib/main.jar'], res)
    def test_add_postfix(self):
        self.override_config("job_workflow_postfix", 'caba')
        res = job_manager._add_postfix('aba')
        self.assertEqual("aba/caba/", res)
 
        self.override_config("job_workflow_postfix", '')
        res = job_manager._add_postfix('aba')
        self.assertEqual("aba/", res)
        orig_exec_job_dict = copy.deepcopy(exec_job_dict)
        w.update_job_dict(job_dict, exec_job_dict)
        self.assertEqual(job_dict,
                         {'edp_configs': edp_configs,
                          'configs':  {'default1': 'value1',

src/s/a/sahara-HEAD/sahara/tests/unit/service/edp/test_job_manager.py   sahara(Download)
        res = job_manager.upload_job_files(mock.Mock(), 'job_prefix',
                                           job, 'hadoop')
        self.assertEqual(['job_prefix/script.pig'], res)
 
        job, _ = _create_all_stack(edp.JOB_TYPE_MAPREDUCE)
        res = job_manager.upload_job_files(mock.Mock(), 'job_prefix',
                                           job, 'hadoop')
        self.assertEqual(['job_prefix/lib/main.jar'], res)
    def test_add_postfix(self):
        self.override_config("job_workflow_postfix", 'caba')
        res = job_manager._add_postfix('aba')
        self.assertEqual("aba/caba/", res)
 
        self.override_config("job_workflow_postfix", '')
        res = job_manager._add_postfix('aba')
        self.assertEqual("aba/", res)
        orig_exec_job_dict = copy.deepcopy(exec_job_dict)
        w.update_job_dict(job_dict, exec_job_dict)
        self.assertEqual(job_dict,
                         {'edp_configs': edp_configs,
                          'configs':  {'default1': 'value1',

src/s/a/sahara-HEAD/sahara/tests/unit/plugins/vanilla/test_utils.py   sahara(Download)
    def test_get_namenode(self):
        cl = tu.create_cluster('cl1', 't1', 'vanilla', '1.2.1',
                               [self.ng_manager, self.ng_namenode])
        self.assertEqual('nn1', u.get_namenode(cl).instance_id)
 
    def test_get_jobtracker(self):
        cl = tu.create_cluster('cl1', 't1', 'vanilla', '1.2.1',
                               [self.ng_manager, self.ng_jobtracker])
        self.assertEqual('jt1', u.get_jobtracker(cl).instance_id)
 
    def test_get_oozie(self):
        cl = tu.create_cluster('cl1', 't1', 'vanilla', '1.2.1',
                               [self.ng_manager, self.ng_oozie])
        self.assertEqual('ooz1', u.get_oozie(cl).instance_id)
 
    def test_get_hiveserver(self):
        cl = tu.create_cluster('cl1', 't1', 'vanilla', '1.2.1',
                               [self.ng_manager, self.ng_hiveserver])
        self.assertEqual('hs1', u.get_hiveserver(cl).instance_id)
 
                                self.ng_datanode])
        datanodes = u.get_datanodes(cl)
        self.assertEqual(2, len(datanodes))
        self.assertEqual(set(['dn1', 'dn2']),
                         set([datanodes[0].instance_id,

src/s/a/sahara-2014.1/sahara/tests/unit/service/test_volumes.py   sahara(Download)
 
        self.assertIsNone(volumes._mount_volume(instance, '123', '456'))
        self.assertEqual(execute_com.call_count, 3)
 
        execute_com.side_effect = ex.RemoteCommandException('cmd')
 
        volumes.attach(cluster)
        self.assertEqual(p_create_attach_vol.call_count, 4)
        self.assertEqual(p_await.call_count, 2)
        self.assertEqual(p_mount.call_count, 4)
        self.assertEqual(p_dev_path.call_count, 2)

src/s/a/sahara-HEAD/sahara/tests/unit/service/test_volumes.py   sahara(Download)
 
        self.assertIsNone(volumes._mount_volume(instance, '123', '456'))
        self.assertEqual(execute_com.call_count, 3)
 
        execute_com.side_effect = ex.RemoteCommandException('cmd')
 
        volumes.attach(cluster)
        self.assertEqual(p_create_attach_vol.call_count, 4)
        self.assertEqual(p_await.call_count, 2)
        self.assertEqual(p_mount.call_count, 4)
        self.assertEqual(p_dev_path.call_count, 2)

src/s/a/sahara-2014.1/sahara/tests/unit/conductor/test_api.py   sahara(Download)
 
        updated_cluster = self.api.cluster_get(ctx, cluster.id)
        self.assertEqual(updated_cluster['name'], 'changed')
 
        self.api.cluster_destroy(ctx, updated_cluster.id)
        cluster_list = self.api.cluster_get_all(ctx)
        self.assertEqual(len(cluster_list), 0)
 
        ng = self._get_by_id(cluster.node_groups, ng_id)
        self.assertEqual(ng.name, 'changed_ng')
 
    def test_add_instance_to_node_group_id(self):
 
        ng = self._get_by_id(cluster.node_groups, ng_id)
        self.assertEqual(ng.instances[0].instance_name, 'tst123')
 

  1 | 2  Next