Add Proxy unit tests - Fix #30
This commit is contained in:
@@ -7,34 +7,41 @@ require 'test/unit'
|
|||||||
|
|
||||||
class TC_Proxy < Test::Unit::TestCase
|
class TC_Proxy < Test::Unit::TestCase
|
||||||
|
|
||||||
def setup
|
class << self
|
||||||
$:.unshift(File.join(File.expand_path(File.dirname(__FILE__)), '.'))
|
|
||||||
$root_dir = File.expand_path('../../../../', __FILE__)
|
def startup
|
||||||
|
$root_dir = '../../'
|
||||||
|
$:.unshift(File.expand_path($root_dir))
|
||||||
|
|
||||||
|
# load extension
|
||||||
|
require 'extensions/proxy/extension'
|
||||||
|
|
||||||
|
# load config
|
||||||
|
BeEF::Core::Configuration.new(File.join($root_dir, 'config.yaml'))
|
||||||
|
config = BeEF::Core::Configuration.instance
|
||||||
|
config.load_extensions_config
|
||||||
|
@@proxy_config = config.get('beef.extension.proxy')
|
||||||
|
end
|
||||||
|
|
||||||
|
def shutdown
|
||||||
|
$root_dir = nil
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_proxy
|
# Connects to in-memory database (does not test anything)
|
||||||
assert(true)
|
def test_01_database
|
||||||
|
DataMapper.setup(:default, 'sqlite3::memory:')
|
||||||
|
DataMapper.auto_migrate!
|
||||||
end
|
end
|
||||||
def test_delete
|
|
||||||
assert(true)
|
# Checks for required settings in config file
|
||||||
end
|
def test_02_config
|
||||||
def test_put
|
assert(@@proxy_config.has_key?('enable'))
|
||||||
assert(true)
|
assert(@@proxy_config.has_key?('address'))
|
||||||
end
|
assert(@@proxy_config.has_key?('port'))
|
||||||
def test_head
|
assert(@@proxy_config.has_key?('key'))
|
||||||
assert(true)
|
assert(@@proxy_config.has_key?('cert'))
|
||||||
end
|
|
||||||
def test_no_params
|
|
||||||
assert(true)
|
|
||||||
end
|
|
||||||
def test_zero_values
|
|
||||||
assert(true)
|
|
||||||
end
|
|
||||||
def test_one_values
|
|
||||||
assert(true)
|
|
||||||
end
|
|
||||||
def test_neg_one_values
|
|
||||||
assert(true)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user