Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] <rest-service> master : Bump coverage
  • From: Klaus Kämpf <kkaempf@xxxxxxx>
  • Date: Tue, 7 Jul 2009 17:05:32 +0200
  • Message-id: <E1MOCEl-0003L9-Ti@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 6cd142825e2ef2393bb9d11bf7735817248bf14e
Author: Klaus Kämpf <kkaempf@xxxxxxx>
Date: Tue Jul 7 17:05:32 2009 +0200

Bump coverage
---
webservice/test/functional/yast_roles_test.rb | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/webservice/test/functional/yast_roles_test.rb
b/webservice/test/functional/yast_roles_test.rb
index 5b08275..34a52da 100644
--- a/webservice/test/functional/yast_roles_test.rb
+++ b/webservice/test/functional/yast_roles_test.rb
@@ -11,8 +11,6 @@ end
class YastRolesTest < ActiveSupport::TestCase
include YastRoles

- session = Hash.new
-
attr_reader :current_account

def setup
@@ -21,8 +19,10 @@ class YastRolesTest < ActiveSupport::TestCase
end

def test_permission_check_trivial
+ save = ENV["RAILS_ENV"]
ENV["RAILS_ENV"] = "test"
assert permission_check(nil)
+ ENV["RAILS_ENV"] = save
end

def test_permission_check_no_account
@@ -37,4 +37,20 @@ class YastRolesTest < ActiveSupport::TestCase
def test_action_dummy
assert !permission_check("dummy")
end
+
+ def test_polkit_override
+ def PolKit.polkit_check(action,login) return :yes if action ==
"test_polkit_override" end
+ assert permission_check("test_polkit_override")
+ end
+
+ def test_role_ok
+ def PolKit.polkit_check(action,login) return :yes if login ==
"network_admin" end
+ assert permission_check("dummy")
+ end
+
+ def test_role_not_ok
+ @current_account = CurrentLogin.new "nobody"
+ def PolKit.polkit_check(action,login) return :yes if login ==
"network_admin" end
+ assert !permission_check("dummy")
+ end
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages