def is_on_server(self): """Check the event associated with this instance exists on the server. :return: True if valid, False if not :raises: NetworkError """ input_file_name, output_file_name = self.file_names() file_list = [input_file_name, output_file_name] ftp_client = FtpClient() return ftp_client.has_files(file_list)
def test_has_files(self): """Test that the ftp client can check if a list of file exists""" client = FtpClient() input_files = ['20120726022003.inp.zip', '20120726022003.out.zip'] message = ('Expected that %s exist on the server' % input_files) self.assertTrue(client.has_files(input_files), message)