Commit 2a83fa53 authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

improving test to check client body temp dir still empty after publish a big message

parent a2dba6bc
......@@ -85,6 +85,7 @@ module BaseTestCase
File.delete(@main_error_log) if File.exist?(@main_error_log)
File.delete(@access_log) if File.exist?(@access_log)
File.delete(@error_log) if File.exist?(@error_log)
FileUtils.rm_rf(@client_body_temp) if File.exist?(@client_body_temp)
end
end
......
......@@ -194,6 +194,7 @@ class TestPublisher < Test::Unit::TestCase
pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s).post :head => headers, :body => body, :timeout => 30
pub_1.callback {
assert_equal(200, pub_1.response_header.status, "Request was not accepted")
fail("Let a file on client body temp dir") unless Dir.entries(@client_body_temp).select {|f| f if File.file?(File.expand_path(f, @client_body_temp)) }.empty?
EventMachine.stop
}
}
......@@ -218,6 +219,7 @@ class TestPublisher < Test::Unit::TestCase
pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s).post :head => headers, :body => body, :timeout => 30
pub_1.callback {
assert_equal(200, pub_1.response_header.status, "Request was not accepted")
fail("Let a file on client body temp dir") unless Dir.entries(@client_body_temp).select {|f| f if File.file?(File.expand_path(f, @client_body_temp)) }.empty?
EventMachine.stop
}
}
......
......@@ -197,6 +197,7 @@ class TestPublisherAdmin < Test::Unit::TestCase
pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s).post :head => headers, :body => body, :timeout => 30
pub_1.callback {
assert_equal(200, pub_1.response_header.status, "Request was not accepted")
fail("Let a file on client body temp dir") unless Dir.entries(@client_body_temp).select {|f| f if File.file?(File.expand_path(f, @client_body_temp)) }.empty?
EventMachine.stop
}
}
......@@ -221,6 +222,7 @@ class TestPublisherAdmin < Test::Unit::TestCase
pub_1 = EventMachine::HttpRequest.new(nginx_address + '/pub?id=' + channel.to_s).post :head => headers, :body => body, :timeout => 30
pub_1.callback {
assert_equal(200, pub_1.response_header.status, "Request was not accepted")
fail("Let a file on client body temp dir") unless Dir.entries(@client_body_temp).select {|f| f if File.file?(File.expand_path(f, @client_body_temp)) }.empty?
EventMachine.stop
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment