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)
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)
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)
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)