def test_check_hdfs_path_dest_dir(self): """ unit testing that check_hdfs_path method returns correct value when directory does exist in hdfs. """ self.opts.update({'destination': VALID_DEST_DIR}) t_hadoopcluster = HadoopCluster(self.opts) status = t_hadoopcluster.check_hdfs_path(self.master_IP, self.opts['destination'], '-d') self.assertEqual(status, 0)
def test_check_hdfs_path_dest_dir(self): """ unit testing that check_hdfs_path method returns correct value when directory does exist in hdfs. """ self.opts.update({'destination': self.VALID_DEST_DIR}) t_hadoopcluster = HadoopCluster(self.opts) status = t_hadoopcluster.check_hdfs_path(self.master_IP, self.opts['destination'], '-d') self.assertEqual(status, 0)
def test_check_hdfs_path_dest_file(self): """ unit testing that check_hdfs_path method returns correct value when file does not exist in hdfs. """ self.opts.update({'destination': VALID_DEST_FILE}) t_hadoopcluster = HadoopCluster(self.opts) status = t_hadoopcluster.check_hdfs_path(self.master_IP, self.opts['destination'], '-e') self.assertNotEqual(status, 0)
def test_check_hdfs_path_dest_file(self): """ unit testing that check_hdfs_path method returns correct value when file does not exist in hdfs. """ self.opts.update({'destination': VALID_DEST_FILE}) t_hadoopcluster = HadoopCluster(self.opts) status = t_hadoopcluster.check_hdfs_path(self.master_IP, self.opts['destination'], '-e') self.assertNotEqual(status, 0)