Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Expected: "Fail" Actual: "Success" running template _test.rb

Hello, I'm new to using OpenStudio and am trying to write my own measure for the first time. So far I'm using the measure template produced by open studio, and have only modified the arguments section (I've copied that in at the bottom). When I run the _test.rb template def test_bad_arguments section, I get a failure:

1) Failure: OccupancyTestTest#test_bad_argument_values [C:/.../occupancy_test_test.rb:68]: Expected: "Fail" Actual: "Success"

My questions are What exactly is this section testing for? Why is it producing a Failure?

I'm new so please tell me if I've made a very obvious error!

Kind thanks.

def arguments(model)

args = OpenStudio::Measure::OSArgumentVector.new
# the name of the file to import to the model
file_name = OpenStudio::Measure::OSArgument.makeStringArgument("file_name", true)
file_name.setDisplayName('CSV File Name')
file_name.setDescription('This name will be used as the name of the CSV file to load.')
file_name.setDefaultValue("Nov20GT.txt")
args << file_name

sched_name = OpenStudio::Measure::OSArgument.makeStringArgument("sched_name", true)
sched_name.setDisplayName('Ground Truth Schedule')
sched_name.setDescription('Ground Truth Schedule from CC Occupancy Data')
sched_name.setDefaultValue('Ground Truth Schedule')
args << sched_name
return args

end