Mailinglist Archive: yast-commit (1771 mails)

< Previous Next >
[yast-commit] <rest-service> basesystem : test read_status method, fixed mocked values
  • From: Ladislav Slezak <lslezak@xxxxxxxxxx>
  • Date: Mon, 31 Aug 2009 09:55:02 +0200
  • Message-id: <E1Mj7Kb-0002qm-7B@xxxxxxxxxxxxxxxx>
ref: refs/heads/basesystem
commit e05491b8072d8df298a047efb116640842e3399b
Author: Ladislav Slezak <lslezak@xxxxxxxxxx>
Date: Fri Aug 28 12:38:40 2009 +0200

test read_status method, fixed mocked values
---
plugins/services/test/unit/services_test.rb | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/services/test/unit/services_test.rb
b/plugins/services/test/unit/services_test.rb
index 29c6915..e959eeb 100644
--- a/plugins/services/test/unit/services_test.rb
+++ b/plugins/services/test/unit/services_test.rb
@@ -94,12 +94,14 @@ class ServiceTest < ActiveSupport::TestCase
end

test "check LSB service status" do
- ret = {:exit => 0}
+ ret = {'exit' => '0'}
YastService.stubs(:Call).with('YaPI::SERVICES::Execute', 'ntp',
'status').returns(ret)

YaST::ConfigFile.stubs(:config_default_location).returns(vendor_config('missing'))

s = Service.new('ntp')
assert s.save('status') == ret
+ s.read_status
+ assert s.status == '0'
end


@@ -109,11 +111,13 @@ class ServiceTest < ActiveSupport::TestCase
# do not call introspection in the Scr constructor
DBus::SystemBus.instance.stubs(:introspect).returns('<node><interface
name="org.opensuse.yast.SCR.Methods"></interface></node>')

- ret = {:exit => 0, :stderr => "", :stdout => "Checking for service
collectd ..running\n"}
+ ret = {'exit' => '0', 'stderr' => '', 'stdout' => "Checking for service
collectd ..running\n"}
Scr.instance.stubs(:execute).with(['/usr/sbin/rccollectd
status']).returns(ret)

s = Service.new('vendor_service')
assert s.save("status") == ret
+ s.read_status
+ assert s.status == '0'
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