Skip to content

Commit

Permalink
fixes to the invalid command spec
Browse files Browse the repository at this point in the history
  • Loading branch information
emiltin committed Jul 11, 2023
1 parent 515f15e commit 295c669
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions spec/site/tlc/invalid_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
log "Sending M0001"
command_list = build_command_list :M0001, :setValue, {
securityCode: Validator.config['secrets']['security_codes'][2],
status: 'NormalControl',
timeout: 0,
intersection: 0
intersection: 0,
status: 'NormalControl'
}
result = site.send_command '', command_list,
result = site.send_command(
'bad', command_list,
collect: { timeout: Validator.config['timeouts']['command_response'] },
validate: false # disable validation of outgoing message
)
Expand Down Expand Up @@ -49,8 +50,11 @@
it 'returns NotAck' do |example|
Validator::Site.connected do |task,supervisor,site|
log "Sending non-existing command M0000"
command_list = build_command_list :M0000, :bad, {}
command_list = build_command_list :M0000, :wrong, {
status: 'wrong'
}
result = site.send_command Validator.config['main_component'], command_list,
securityCode: Validator.config['secrets']['security_codes'][2],
collect: { timeout: Validator.config['timeouts']['command_response'] },
validate: false # disable validation of outgoing message
collector = result[:collector]
Expand All @@ -72,9 +76,9 @@

it 'returns NotAck' do |example|
Validator::Site.connected do |task,supervisor,site|
log "Sending M0001 with 'status' attribute missing"
log "Sending M0001 with empty 'status' attribute"
command_list = build_command_list :M0001, :setValue, {
securityCode: '1111',
securityCode: Validator.config['secrets']['security_codes'][2],
intersection: '0',
timeout: '0'
# intentionally not setting 'status'
Expand Down Expand Up @@ -103,10 +107,11 @@
Validator::Site.connected do |task,supervisor,site|
log "Sending M0001"
# for M0001, cO should be :setValue, here we use the incorrect :bad
command_list = build_command_list :M0001, :bad, {
securityCode: '1111',
command_list = build_command_list :M0001, :wrong, {
securityCode: Validator.config['secrets']['security_codes'][2],
intersection: '0',
timeout: '0'
timeout: '0',
status: 'NormalControl'
}
result = site.send_command Validator.config['main_component'], command_list,
collect: { timeout: Validator.config['timeouts']['command_response'] },
Expand Down

0 comments on commit 295c669

Please sign in to comment.