openstudio-analysis 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/openstudio/analysis/translator/excel.rb +2 -1
- data/lib/openstudio/analysis/version.rb +1 -1
- data/spec/files/analysis/medium_office.json +192 -192
- data/spec/files/analysis/medium_office.zip +0 -0
- data/spec/files/export/analysis/Kats model v2.json +461 -0
- data/spec/files/export/analysis/Kats model v2.zip +0 -0
- data/spec/files/export/analysis/discrete_dynamic_seed.json +461 -0
- data/spec/files/export/analysis/discrete_dynamic_seed.zip +0 -0
- data/spec/files/export/analysis/discrete_seed.json +736 -0
- data/spec/files/export/analysis/discrete_seed.zip +0 -0
- data/spec/files/export/analysis/output_vars.json +707 -0
- data/spec/files/export/analysis/output_vars.zip +0 -0
- data/spec/files/export/analysis/small_seed.json +665 -0
- data/spec/files/export/analysis/small_seed.zip +0 -0
- data/spec/files/template_0_2_0_simpletest.xlsx +0 -0
- data/spec/files/{~$template_0_2_0.xlsx → ~$template_0_2_0_simpletest.xlsx} +0 -0
- data/spec/openstudio/analysis/translator/excel_spec.rb +316 -289
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-create-a-new-localhost-instance.64.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi-test-not-localhost.64.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-ServerApi.64.xml +7 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-variables.22.xml +18 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-discrete-with-dynamic-columns.6.xml +17 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-no-variables-defined.64.xml +20 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup-with-user.30.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-proxy-setup.36.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-output-variables.16.xml +36 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-setup-version-0-1-9.13.xml +21 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-incomplete-variables.64.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables-should-not-validate.64.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-of-variables.64.xml +23 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-small-list-with-with-repeated-variable-names.64.xml +9 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-1-10.13.xml +13 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel-version-0-2-0.xml +32 -0
- data/spec/reports/SPEC-OpenStudio-Analysis-Translator-Excel.64.xml +7 -0
- metadata +60 -6
- data/spec/files/~$template_input_0.1.10.xlsx +0 -0
@@ -1,300 +1,300 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe OpenStudio::Analysis::Translator::Excel do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
4
|
+
context "no variables defined" do
|
5
|
+
let(:path) { "spec/files/no_variables.xlsx" }
|
6
|
+
|
7
|
+
before(:each) do
|
8
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new(path)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should have measure path" do
|
12
|
+
expect(@excel.measure_path).to eq("./measures")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should have excel data" do
|
16
|
+
puts @excel
|
17
|
+
expect(@excel).not_to be_nil
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should process the excel file" do
|
21
|
+
expect(@excel.process).to eq(true)
|
22
|
+
|
23
|
+
# after processing the measures directory should be what is in the excel file
|
24
|
+
expect(@excel.measure_path).to eq(File.expand_path(File.join("spec", "files", "measures")))
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should not work because no variables defined" do
|
28
|
+
#old_path = @excel.measure_path
|
29
|
+
#@excel.measure_path = "path/does/not/exist"
|
30
|
+
#
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should not export to a JSON" do
|
34
|
+
@excel.process
|
35
|
+
expect { @excel.save_analysis }.to raise_error("Argument 'r_value' did not process. Most likely it did not have all parameters defined.")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context "small list of incomplete variables" do
|
40
|
+
before(:all) do
|
41
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/small_list_incomplete.xlsx")
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should fail to process" do
|
45
|
+
expect { @excel.process }.to raise_error("Variable adjust_thermostat_setpoints_by_degrees:cooling_adjustment must have a mean")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context "small list with with repeated variable names" do
|
50
|
+
before(:all) do
|
51
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/small_list_repeat_vars.xlsx")
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should fail to process" do
|
55
|
+
expect { @excel.process }.to raise_error("duplicate variable names found in list [\"Insulation R-value (ft^2*h*R/Btu).\"]")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "small list of variables should not validate" do
|
60
|
+
before(:all) do
|
61
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/small_list_validation_errors.xlsx")
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should fail to process" do
|
65
|
+
expect { @excel.process }.to raise_error("Variable min is greater than variable max for adjust_thermostat_setpoints_by_degrees:heating_adjustment")
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context "small list of variables" do
|
70
|
+
before(:all) do
|
71
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/small_list.xlsx")
|
72
|
+
@excel.process
|
73
|
+
end
|
74
|
+
it "should have a model" do
|
75
|
+
expect(@excel.models.first).not_to be_nil
|
76
|
+
expect(@excel.models.first[:name]).to eq("small_seed")
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should have a weather file" do
|
80
|
+
expect(@excel.weather_files.first).not_to be_nil
|
81
|
+
puts @excel.weather_files.first
|
82
|
+
expect(@excel.weather_files.first.include?("partial_weather.epw")).to eq(true)
|
83
|
+
end
|
84
|
+
|
85
|
+
it "should have notes and source" do
|
86
|
+
@excel.variables['data'].each do |measure|
|
87
|
+
measure['variables'].each do |var|
|
88
|
+
if var['machine_name'] == 'lighting_power_reduction'
|
89
|
+
expect(var['distribution']['source']).to eq("some data source")
|
90
|
+
elsif var['machine_name'] == 'demo_cost_initial_const'
|
91
|
+
expect(var['notes']).to eq("some note")
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should write a json" do
|
98
|
+
@excel.save_analysis
|
99
|
+
expect(File).to exist("spec/files/export/analysis/small_seed.json")
|
100
|
+
expect(File).to exist("spec/files/export/analysis/small_seed.zip")
|
101
|
+
|
102
|
+
expect(JSON.parse(File.read("spec/files/export/analysis/small_seed.json"))).not_to be_nil
|
103
|
+
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
context "setup version 0.1.9" do
|
108
|
+
before(:all) do
|
109
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/setup_version_2.xlsx")
|
110
|
+
@excel.process
|
111
|
+
end
|
112
|
+
|
113
|
+
it "should have a version and machine name" do
|
114
|
+
expect(@excel.version).to eq("0.1.9")
|
115
|
+
expect(@excel.machine_name).to eq("example_analysis")
|
116
|
+
end
|
117
|
+
it "should have the new settings" do
|
118
|
+
expect(@excel.settings["server_instance_type"]).to eq("m2.xlarge")
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should have algorithm setup" do
|
122
|
+
expect(@excel.algorithm["number_of_samples"]).to eq(100)
|
123
|
+
expect(@excel.algorithm["number_of_generations"]).to eq(20)
|
124
|
+
expect(@excel.algorithm["sample_method"]).to eq("all_variables")
|
125
|
+
expect(@excel.algorithm["number_of_generations"]).to be_a Integer
|
126
|
+
expect(@excel.algorithm["tolerance"]).to eq(0.115)
|
127
|
+
expect(@excel.algorithm["tolerance"]).to be_a Float
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
it "should create a valid hash" do
|
132
|
+
h = @excel.create_analysis_hash
|
133
|
+
|
134
|
+
expect(h['analysis']['problem']['analysis_type']).to eq("lhs")
|
135
|
+
expect(h['analysis']['problem']['algorithm']).not_to be_nil
|
136
|
+
expect(h['analysis']['problem']['algorithm']['number_of_samples']).to eq(100)
|
137
|
+
expect(h['analysis']['problem']['algorithm']['sample_method']).to eq("all_variables")
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
context "proxy setup" do
|
142
|
+
before(:all) do
|
143
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/proxy.xlsx")
|
144
|
+
@excel.process
|
145
|
+
end
|
146
|
+
|
147
|
+
it "should have a proxy setting" do
|
148
|
+
expect(@excel.settings["proxy_host"]).to eq("192.168.0.1")
|
149
|
+
expect(@excel.settings["proxy_port"]).to eq(8080)
|
150
|
+
expect(@excel.settings["proxy_username"]).to be_nil
|
151
|
+
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
context "proxy setup with user" do
|
156
|
+
before(:all) do
|
157
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/proxy_user.xlsx")
|
158
|
+
@excel.process
|
159
|
+
end
|
160
|
+
|
161
|
+
it "should have a user" do
|
162
|
+
expect(@excel.settings["proxy_host"]).to eq("192.168.0.1")
|
163
|
+
expect(@excel.settings["proxy_port"]).to eq(8080)
|
164
|
+
expect(@excel.settings["proxy_username"]).to eq("a_user")
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
context "discrete variables" do
|
169
|
+
before(:all) do
|
170
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/discrete_variables.xlsx")
|
171
|
+
@excel.process
|
172
|
+
end
|
173
|
+
|
174
|
+
it "should have parsed the spreadsheet" do
|
175
|
+
@excel.variables['data'].each do |measure|
|
176
|
+
measure['variables'].each do |var|
|
177
|
+
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
it "should save the file" do
|
183
|
+
@excel.save_analysis
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
context "discrete with dynamic columns" do
|
188
|
+
before(:all) do
|
189
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/discrete_dynamic_columns.xlsx")
|
190
|
+
@excel.process
|
191
|
+
end
|
192
|
+
|
193
|
+
it "should have parsed the spreadsheet" do
|
194
|
+
@excel.variables['data'].each do |measure|
|
195
|
+
measure['variables'].each do |var|
|
196
|
+
puts var.inspect
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
it "should save the file" do
|
202
|
+
@excel.save_analysis
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
context "setup output variables" do
|
207
|
+
before(:all) do
|
208
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/outputvars.xlsx")
|
209
|
+
@excel.process
|
210
|
+
end
|
211
|
+
|
212
|
+
it "should have a model" do
|
213
|
+
expect(@excel.models.first).not_to be_nil
|
214
|
+
expect(@excel.models.first[:name]).to eq("output_vars")
|
215
|
+
end
|
216
|
+
|
217
|
+
it "should have a weather file" do
|
218
|
+
expect(@excel.weather_files.first).not_to be_nil
|
219
|
+
puts @excel.weather_files.first
|
220
|
+
expect(@excel.weather_files.first.include?("partial_weather.epw")).to eq(true)
|
221
|
+
end
|
222
|
+
|
223
|
+
it "should have notes and source" do
|
224
|
+
@excel.variables['data'].each do |measure|
|
225
|
+
measure['variables'].each do |var|
|
226
|
+
if var['machine_name'] == 'lighting_power_reduction'
|
227
|
+
expect(var['distribution']['source']).to eq("some data source")
|
228
|
+
elsif var['machine_name'] == 'demo_cost_initial_const'
|
229
|
+
expect(var['notes']).to eq("some note")
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
it "should have typed booleans" do
|
236
|
+
expect(@excel.run_setup['use_server_as_worker']).to eq(true)
|
237
|
+
expect(@excel.run_setup['allow_multiple_jobs']).to eq(true)
|
238
|
+
end
|
239
|
+
|
240
|
+
it "should have algorithm setup" do
|
241
|
+
expect(@excel.algorithm["number_of_samples"]).to eq(100)
|
242
|
+
expect(@excel.algorithm["number_of_generations"]).to eq(20)
|
243
|
+
expect(@excel.algorithm["sample_method"]).to eq("all_variables")
|
244
|
+
expect(@excel.algorithm["number_of_generations"]).to be_a Integer
|
245
|
+
#expect(@excel.algorithm["tolerance"]).to eq(0.115)
|
246
|
+
#expect(@excel.algorithm["tolerance"]).to be_a Float
|
247
|
+
|
248
|
+
end
|
249
|
+
|
250
|
+
it "should create a valid hash" do
|
251
|
+
h = @excel.create_analysis_hash
|
252
|
+
|
253
|
+
expect(h['analysis']['problem']['analysis_type']).to eq("nsga")
|
254
|
+
expect(h['analysis']['problem']['algorithm']).not_to be_nil
|
255
|
+
expect(h['analysis']['problem']['algorithm']['number_of_samples']).to eq(100)
|
256
|
+
expect(h['analysis']['problem']['algorithm']['sample_method']).to eq("all_variables")
|
257
|
+
end
|
258
|
+
|
259
|
+
|
260
|
+
it "should write a json" do
|
261
|
+
@excel.save_analysis
|
262
|
+
expect(File).to exist("spec/files/export/analysis/output_vars.json")
|
263
|
+
expect(File).to exist("spec/files/export/analysis/output_vars.zip")
|
264
|
+
|
265
|
+
expect(JSON.parse(File.read("spec/files/export/analysis/output_vars.json"))).not_to be_nil
|
266
|
+
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
context "version 0.1.10" do
|
271
|
+
before(:all) do
|
272
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/template_input_0.1.10.xlsx")
|
273
|
+
end
|
274
|
+
|
275
|
+
it "should process" do
|
276
|
+
expect(@excel.process).to eq(true)
|
277
|
+
end
|
278
|
+
|
279
|
+
it "should have new setting variables" do
|
280
|
+
puts @excel.settings.inspect
|
281
|
+
expect(@excel.settings["user_id"]).to eq('new_user')
|
282
|
+
expect(@excel.settings["openstudio_server_version"]).to eq('1.3.2')
|
283
|
+
expect(@excel.cluster_name).to eq('analysis_cluster')
|
284
|
+
puts @excel.run_setup.inspect
|
285
|
+
expect(@excel.run_setup["analysis_name"]).to eq('LHS Example Project')
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
289
|
context "version 0.2.0" do
|
290
290
|
before(:all) do
|
291
291
|
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/template_0_2_0.xlsx")
|
292
292
|
end
|
293
|
-
|
293
|
+
|
294
294
|
it "should process" do
|
295
295
|
expect(@excel.process).to eq(true)
|
296
296
|
end
|
297
|
-
|
297
|
+
|
298
298
|
it "should have new setting variables" do
|
299
299
|
puts @excel.settings.inspect
|
300
300
|
expect(@excel.settings["user_id"]).to eq('new_user')
|
@@ -307,12 +307,39 @@ describe OpenStudio::Analysis::Translator::Excel do
|
|
307
307
|
it "should have the new measure directory column" do
|
308
308
|
expect(@excel.variables['data'][1]['measure_file_name_directory']).to eq('ReduceLightingLoadsByPercentage')
|
309
309
|
end
|
310
|
-
|
310
|
+
|
311
311
|
it "should write a json" do
|
312
312
|
@excel.save_analysis
|
313
313
|
end
|
314
314
|
end
|
315
|
-
|
315
|
+
|
316
|
+
context "version 0.2.0 simple" do
|
317
|
+
before(:all) do
|
318
|
+
@excel = OpenStudio::Analysis::Translator::Excel.new("spec/files/template_0_2_0_simpletest.xlsx")
|
319
|
+
end
|
320
|
+
|
321
|
+
it "should process" do
|
322
|
+
expect(@excel.process).to eq(true)
|
323
|
+
end
|
324
|
+
|
325
|
+
it "should have new setting variables" do
|
326
|
+
puts @excel.settings.inspect
|
327
|
+
expect(@excel.settings["user_id"]).to eq('new_user')
|
328
|
+
expect(@excel.settings["openstudio_server_version"]).to eq('1.3.2')
|
329
|
+
puts @excel.run_setup.inspect
|
330
|
+
end
|
331
|
+
|
332
|
+
it "should have the new measure directory column" do
|
333
|
+
expect(@excel.variables['data'][1]['measure_file_name_directory']).to eq('AdjustThermostatSetpointsByDegrees')
|
334
|
+
expect(@excel.variables['data'][0]['measure_file_name_directory']).to eq('baseline')
|
335
|
+
end
|
336
|
+
|
337
|
+
it "should write a json" do
|
338
|
+
@excel.save_analysis
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
|
316
343
|
|
317
344
|
end
|
318
345
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<testsuite name="OpenStudio::Analysis::ServerApi create a new localhost instance" tests="1" time="0.033967" failures="0" errors="0" skipped="0" timestamp="2014-04-17T15:12:48-06:00">
|
3
|
+
<testcase name="OpenStudio::Analysis::ServerApi create a new localhost instance should set the default host to localhost" time="0.000534">
|
4
|
+
</testcase>
|
5
|
+
<system-out>
|
6
|
+
</system-out>
|
7
|
+
<system-err>
|
8
|
+
</system-err>
|
9
|
+
</testsuite>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<testsuite name="OpenStudio::Analysis::ServerApi test not localhost" tests="1" time="0.000779" failures="0" errors="0" skipped="0" timestamp="2014-04-17T15:12:48-06:00">
|
3
|
+
<testcase name="OpenStudio::Analysis::ServerApi test not localhost should have a not localhost URL" time="0.00045">
|
4
|
+
</testcase>
|
5
|
+
<system-out>
|
6
|
+
</system-out>
|
7
|
+
<system-err>
|
8
|
+
</system-err>
|
9
|
+
</testsuite>
|