def test_default_name(self, mock_path): """Function: test_default_name Description: Test for default file name. Arguments: """ mock_path.join.side_effect = [self.t_file, self.f_name] self.assertFalse( rmq_metadata._convert_data(self.rmq, self.logger, self.cfg, self.cfg.queue_list[0], self.body, self.method.routing_key))
def test_file_not_encoded(self, mock_path): """Function: test_file_not_encoded Description: Test with file not encoded. Arguments: """ self.cfg.queue_list[0]["stype"] = "not_encoded" mock_path.join.side_effect = [self.t_file, self.f_name] self.assertFalse( rmq_metadata._convert_data(self.rmq, self.logger, self.cfg, self.cfg.queue_list[0], self.body, self.method.routing_key))
def test_no_ext(self, mock_path): """Function: test_no_ext Description: Test with no extension set. Arguments: """ self.cfg.queue_list[0]["ext"] = None mock_path.join.side_effect = [self.t_file, self.f_name] self.assertFalse( rmq_metadata._convert_data(self.rmq, self.logger, self.cfg, self.cfg.queue_list[0], self.body, self.method.routing_key))
def test_ext_change(self, mock_path): """Function: test_ext_change Description: Test with change to default extension. Arguments: """ self.cfg.queue_list[0]["ext"] = "txt" mock_path.join.side_effect = [self.t_file, self.f_name] self.assertFalse( rmq_metadata._convert_data(self.rmq, self.logger, self.cfg, self.cfg.queue_list[0], self.body, self.method.routing_key))
def test_prename_postname(self, mock_path): """Function: test_prename_postname Description: Test with change to prename and postname. Arguments: """ self.cfg.queue_list[0]["prename"] = "pre_name" self.cfg.queue_list[0]["postname"] = "post_name" mock_path.join.side_effect = [self.t_file, self.f_name] self.assertFalse( rmq_metadata._convert_data(self.rmq, self.logger, self.cfg, self.cfg.queue_list[0], self.body, self.method.routing_key))