コード例 #1
0
ファイル: hdfs_test.py プロジェクト: zhengganglee/commons
 def test_hadoop_v1(self):
     hdfs_helper = HDFSHelper("/etc/hadoop/hadoop-conf-tst-smf1",
                              command_class=MockCommandUtil,
                              use_hadoop_v1=True)
     cmd = hdfs_helper.get(['src'], "dst")
     expected_cmd = "hadoop --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -get src dst"
     self.assertEqual(cmd, expected_cmd)
     cmd = hdfs_helper.mkdir('dest')
     expected_cmd = "hadoop --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -mkdir dest"
     self.assertEqual(cmd, expected_cmd)
     cmd = hdfs_helper.cp('src', 'dest')
     expected_cmd = "hadoop --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -cp src dest"
     self.assertEqual(cmd, expected_cmd)
コード例 #2
0
ファイル: hdfs_test.py プロジェクト: jayeye/commons
 def test_hadoop_v1(self):
   hdfs_helper = HDFSHelper("/etc/hadoop/hadoop-conf-tst-smf1",
                            command_class=MockCommandUtil,
                            use_hadoop_v1=True)
   cmd = hdfs_helper.get(['src'],"dst")
   expected_cmd = "hadoop --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -get src dst"
   self.assertEqual(cmd, expected_cmd)
   cmd = hdfs_helper.mkdir('dest')
   expected_cmd = "hadoop --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -mkdir dest"
   self.assertEqual(cmd, expected_cmd)
   cmd = hdfs_helper.cp('src','dest')
   expected_cmd = "hadoop --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -cp src dest"
   self.assertEqual(cmd, expected_cmd)
コード例 #3
0
ファイル: hdfs_test.py プロジェクト: testvidya11/commons
 def test_mkdir(self):
     hdfs_helper = HDFSHelper("/etc/hadoop/hadoop-conf-tst-smf1",
                              command_class=MockCommandUtil)
     cmd = hdfs_helper.mkdir('dest')
     expected_cmd = "hadoop --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -mkdir dest"
     self.assertEqual(cmd, expected_cmd)
コード例 #4
0
ファイル: hdfs_test.py プロジェクト: jayeye/commons
 def test_mkdir(self):
   hdfs_helper = HDFSHelper("/etc/hadoop/hadoop-conf-tst-smf1",
                            command_class=MockCommandUtil)
   cmd = hdfs_helper.mkdir('dest')
   expected_cmd = "hdfs --config /etc/hadoop/hadoop-conf-tst-smf1 dfs -mkdir dest"
   self.assertEqual(cmd, expected_cmd)