summaryrefslogtreecommitdiff
path: root/test/policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/policy.rb')
-rw-r--r--test/policy.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/test/policy.rb b/test/policy.rb
index c69175d..6babcc6 100644
--- a/test/policy.rb
+++ b/test/policy.rb
@@ -11,12 +11,6 @@ POLICY_NAME = "test_policy_#{rand(100000)}"
RULE_NAME = "test_rule_#{rand(100000)}"
SUBJECT_NAME = "test_subject_#{rand(100000)}"
-AA ||= "https://opensso.in-silico.ch"
-AA_USER = "guest"
-AA_PASS = "guest"
-
-@@subjectid = OpenTox::Authorization.authenticate(AA_USER,AA_PASS)
-
class PolicyTest < Test::Unit::TestCase
def test_01_class
@@ -67,16 +61,16 @@ class PolicyTest < Test::Unit::TestCase
def test_04_group_user
policies = OpenTox::Policies.new()
- policies.load_default_policy(AA_USER, TEST_URI, "member")
+ policies.load_default_policy($aa[:user], TEST_URI, "member")
assert_equal "member", policies.policies["policy_group"].group
- assert_equal AA_USER, policies.policies["policy_user"].user
+ assert_equal $aa[:user], policies.policies["policy_user"].user
end
def test_05_DN
policies = OpenTox::Policies.new()
policies.new_policy(POLICY_NAME)
policy = policies.policies[policies.names[0]]
- policy.set_ot_user(AA_USER)
+ policy.set_ot_user($aa[:user])
assert_equal USER_VALUE, policy.value
assert_equal USER_TYPE, policy.type
policy.set_ot_group(USER_GROUP)
@@ -84,10 +78,9 @@ class PolicyTest < Test::Unit::TestCase
assert_equal GROUP_TYPE, policy.type
end
-=begin
def test_06_load_xml_and_check_defaults
policies = OpenTox::Policies.new()
- xml = File.read(File.join(File.dirname(__FILE__), "../lib/templates/default_policy.xml"))
+ xml = policies.get_xml_template("default_policy")
policies.load_xml(xml)
# check user policy
policy = policies.policies["policy_user"]
@@ -116,6 +109,5 @@ class PolicyTest < Test::Unit::TestCase
assert policy.subject.type == GROUP_TYPE
assert policy.subject.value == GROUP_VALUE
end
-=end
end