Specifications:
Verify status S0201 traffic counting: number of vehicles
-
Given the site is connected
-
Request status
-
Expect status response before timeout
11 12 13 14 15
# File 'spec/site/tlc/traffic_data_spec.rb', line 11 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic counting: number of vehicles", { S0201: [:starttime,:vehicles] }, Validator.get_config('components','detector_logic').keys.first end
-
Verify status S0205 traffic counting: number of vehicles
-
Given the site is connected
-
Request status
-
Expect status response before timeout
24 25 26 27
# File 'spec/site/tlc/traffic_data_spec.rb', line 24 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic counting: number of vehicles", { S0205: [:start,:vehicles] } end
-
Verify status S0202 traffic counting: vehicle speed
-
Given the site is connected
-
Request status
-
Expect status response before timeout
36 37 38 39 40
# File 'spec/site/tlc/traffic_data_spec.rb', line 36 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic counting: vehicle speed", { S0202: [:starttime,:speed] }, Validator.get_config('components','detector_logic').keys.first end
-
Verify status S0206 traffic counting: vehicle speed
-
Given the site is connected
-
Request status
-
Expect status response before timeout
49 50 51 52
# File 'spec/site/tlc/traffic_data_spec.rb', line 49 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic counting: vehicle speed", { S0206: [:start,:speed] } end
-
Verify status S0203 traffic counting: occupancy
-
Given the site is connected
-
Request status
-
Expect status response before timeout
61 62 63 64 65
# File 'spec/site/tlc/traffic_data_spec.rb', line 61 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic counting: occupancy", { S0203: [:starttime,:occupancy] }, Validator.get_config('components','detector_logic').keys.first end
-
Verify status S0207 traffic counting: occupancy
-
Given the site is connected
-
Request status
-
Expect status response before timeout
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
# File 'spec/site/tlc/traffic_data_spec.rb', line 74 Validator::Site.connected do |task,supervisor,site| prepare task, site result = wait_for_status task, "traffic counting: occupancy", { S0207: [:start,:occupancy] }, update_rate: 60 occupancies = result[:collector].matcher_got_hash.dig("S0207","occupancy") start = result[:collector].matcher_got_hash.dig("S0207","start") expect(occupancies).to be_a(String), "Occupancies must be a string, but got nil" expect(start).to be_a(String), "Start must be a string, but got nil" occupancies.split(",").each do |occupancy| num = occupancy.to_i expect((-1..100).cover?(num)).to be_truthy, "Occupancy must be in the range -1..100, got #{num}" end end
-
Verify status S0204 traffic counting: classification
-
Given the site is connected
-
Request status
-
Expect status response before timeout
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
# File 'spec/site/tlc/traffic_data_spec.rb', line 99 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic counting: classification", { S0204: [ :starttime, :P, :PS, :L, :LS, :B, :SP, :MC, :C, :F ] }, Validator.get_config('components','detector_logic').keys.first end
-
Verify status S0208 traffic counting: classification
-
Given the site is connected
-
Request status
-
Expect status response before timeout
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
# File 'spec/site/tlc/traffic_data_spec.rb', line 123 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic counting: classification", { S0208: [ :start, :P, :PS, :L, :LS, :B, :SP, :MC, :C, :F ] } end
-