Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tzumainn committed Oct 24, 2017
1 parent c712ecb commit 29c4339
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
context ".event_to_hash" do
it "with a compute.instance.create.end event" do
event = YAML.load_file(File.join(data_dir, 'compute_instance_create_end.yml'))
data = described_class.event_to_hash(event, 123)
data = described_class.event_to_hash(event, nil)

expected_attributes = common_attributes(event).merge(
:event_type => "compute.instance.create.end",
Expand All @@ -20,7 +20,7 @@

it "with a compute.instance.create.error event" do
event = YAML.load_file(File.join(data_dir, 'compute_instance_create_error.yml'))
data = described_class.event_to_hash(event, 123)
data = described_class.event_to_hash(event, nil)

expected_attributes = common_attributes(event).merge(
:event_type => "compute.instance.create.error",
Expand All @@ -40,7 +40,7 @@

it "with an orchestration.stack.create.end event" do
event = YAML.load_file(File.join(data_dir, 'orchestration_stack_create_end.yml'))
data = described_class.event_to_hash(event, 123)
data = described_class.event_to_hash(event, nil)

expected_attributes = common_attributes(event).merge(
:event_type => "orchestration.stack.create.end",
Expand All @@ -54,7 +54,7 @@

it "with an orchestration.stack.update.end event" do
event = YAML.load_file(File.join(data_dir, 'orchestration_stack_update_end.yml'))
data = described_class.event_to_hash(event, 123)
data = described_class.event_to_hash(event, nil)

expected_attributes = common_attributes(event).merge(
:event_type => "orchestration.stack.update.end",
Expand All @@ -68,11 +68,11 @@

it "with a port.create.end event" do
event = YAML.load_file(File.join(data_dir, 'port_create_end.yml'))
data = described_class.event_to_hash(event, 123)
data = described_class.event_to_hash(event, nil)

expected_attributes = common_attributes(event).merge(
:event_type => "port.create.end",
:timestamp => "2015-05-12 07:22:37.008738"
:timestamp => "2015-05-12 07:22:37.008738",
)

expect(data).to have_attributes(expected_attributes)
Expand All @@ -82,7 +82,7 @@

it "with a port.update.end event" do
event = YAML.load_file(File.join(data_dir, 'port_update_end.yml'))
data = described_class.event_to_hash(event, 123)
data = described_class.event_to_hash(event, nil)

expected_attributes = common_attributes(event).merge(
:event_type => "port.update.end",
Expand All @@ -105,10 +105,9 @@ def common_attributes(event)
:chain_id => nil,
:is_task => nil,
:source => "OPENSTACK",
:message => nil,
:timestamp => nil,
:full_data => event,
:ems_id => 123,
:ems_id => nil,
:username => nil,
:vm_ems_ref => nil,
:vm_name => nil,
Expand Down

0 comments on commit 29c4339

Please sign in to comment.