Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <rest-service> patch_refactor : fix broken test, sorry
  • From: Duncan Mac-Vicar P <dmacvicar@xxxxxxx>
  • Date: Thu, 24 Sep 2009 18:09:51 +0200
  • Message-id: <E1MrI2k-0005yg-DU@xxxxxxxxxxxxxxxx>
ref: refs/heads/patch_refactor
commit 1c972541126f526e1504c6a3ae6fd27bf3c23cec
Author: Duncan Mac-Vicar P <dmacvicar@xxxxxxx>
Date: Thu Sep 24 18:09:51 2009 +0200

fix broken test, sorry
---
plugins/status/test/unit/metric_test.rb | 33 +++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/plugins/status/test/unit/metric_test.rb
b/plugins/status/test/unit/metric_test.rb
index 0004dda..ecda574 100644
--- a/plugins/status/test/unit/metric_test.rb
+++ b/plugins/status/test/unit/metric_test.rb
@@ -75,9 +75,38 @@ class MetricTest < ActiveSupport::TestCase
"starttime"=>Time.at(1252075500)}

assert_equal expected, packets.data(:start => start, :stop => stop)
+
+ xml = Builder::XmlMarkup.new
+ xml.instruct!
+ xml.metric do
+ xml.id "myhost*domain*de+interface+packets"
+ xml.identifier "myhost.domain.de/interface/packets"
+ xml.host "myhost.domain.de"
+ xml.plugin "interface"
+ xml.plugin_instance ""
+ xml.type "packets"
+ xml.type_instance ""
+
+ xml.data(:interval => "10", :column => "tx", :start=>"1252075500") do
+ xml.value 7.79
+ xml.value 61.66
+ xml.value 159.22
+ xml.value 425.76
+ xml.value nil
+ xml.value nil
+ end
+
+ xml.data(:interval => "10", :column => "rx", :start=>"1252075500") do
+ xml.value 22.15
+ xml.value 258.14
+ xml.value 339.62
+ xml.value 280.69
+ xml.value nil
+ xml.value nil
+ end
+ end

- xml = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?><metric><id>myhost*domain*de+interface+packets</id><identifier>myhost.domain.de/interface/packets</identifier><host>myhost.domain.de</host><plugin>interface</plugin><plugin_instance></plugin_instance><type>packets</type><type_instance></type_instance><data
interval=\"10\" column=\"tx\"
start=\"1252075500\"><value>7.79</value><value>61.66</value><value>159.22</value><value>425.76</value><value></value><value></value></data><data
interval=\"10\" column=\"rx\"
start=\"1252075500\"><value>22.15</value><value>258.14</value><value>339.62</value><value>280.69</value><value></value><value></value></data></metric>"
- assert_equal xml, packets.to_xml(:start => start, :stop => stop)
+ assert_equal packets.to_xml(:start => start, :stop => stop), xml.target!
end

def test_collectd_running
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >