<commit_before>require_relative "mock_ftp_server"

require "./test/test_utils"

require "test/unit"
require "net/ftp"
require "digest/md5"

class TestMockFTPServer < Test::Unit::TestCase
	include TestUtils

	MOCK_FTP_PORT = 9999

	def setup
		@ftp_server    = MockFTPServer.new(MOCK_FTP_PORT)
		@server_thread = Thread.new { @ftp_server.start }

		# dirty hack to change the FTP port
		Net::FTP.send(:remove_const, :FTP_PORT)
		Net::FTP.const_set(:FTP_PORT, MOCK_FTP_PORT)

		# login as anonymous
		@ftp = Net::FTP.new("localhost")
		@ftp.login
	end

	def teardown
		@ftp.close
		@server_thread.exit # stop the MockFTPServer#start thread
		clear_tmp
	end

	# Since the class is re-instanciated for each test, we have to
	# wrap them all into this method in order to avoid problem with<commit_msg>change FTP Server port to avoid conflict with the port of the fcp_test<commit_after>require_relative "mock_ftp_server"

require "./test/test_utils"

require "test/unit"
require "net/ftp"
require "digest/md5"

class TestMockFTPServer < Test::Unit::TestCase
	include TestUtils

	MOCK_FTP_PORT = 10000

	def setup
		@ftp_server    = MockFTPServer.new(MOCK_FTP_PORT)
		@server_thread = Thread.new { @ftp_server.start }

		# dirty hack to change the FTP port
		Net::FTP.send(:remove_const, :FTP_PORT)
		Net::FTP.const_set(:FTP_PORT, MOCK_FTP_PORT)

		# login as anonymous
		@ftp = Net::FTP.new("localhost")
		@ftp.login
	end

	def teardown
		@ftp.close
		@server_thread.exit # stop the MockFTPServer#start thread
		clear_tmp
	end

	# Since the class is re-instanciated for each test, we have to
	# wrap them all into this method in order to avoid problem with
{'fraction_non_alphanumeric': 0.09090909090909091, 'fraction_numerical': 0.006666666666666667, 'mean_word_length': 4.485049833887043, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4124542', 'n_tokens_mistral': 638, 'n_tokens_neox': 579, 'n_words': 161}