syncing master

This commit is contained in:
Senad Uka
2017-11-21 17:11:29 +01:00
parent 0eee92660a
commit b4e45199b7
47 changed files with 5666 additions and 263 deletions

View File

@@ -10,6 +10,7 @@ from helix.constants import sql_constant
from helix.constants.anchor_type import AnchorType
from helix.constants.inverter_type import InverterType
from helix.constants.system_type import SystemType
from helix.constants.module_type import ModuleType
from helix.constants.version import version
from helix.models.sql.power_stations import PowerStation
from test.integration.integration_test_helpers import *
@@ -125,29 +126,32 @@ class FullUserFlowTest(unittest.TestCase):
eq_(self.browser._response.headers['Content-Disposition'], 'attachment; filename=test_project_name_result.txt')
def test_downloading_coordinates_csv(self):
with open('test/fixtures/expected_dual_tilt_coordinates.csv', 'r', newline='') as csv_file:
csv_content = csv_file.read()
self.browser.fill('project_name', 'Test Project Name')
self.browser.fill('building_width', '450')
self.browser.fill('building_height', '35')
self.browser.fill('building_length', '500')
self.browser.fill('wind_speed', '110')
self.browser.fill('exposure_category', 'B')
self.browser.fill('ballast_block_weight', '14')
self.browser.fill('building_parapet_height', '5')
self.browser.fill('max_system_pressure', '10')
self.browser.fill('system_type', SystemType.dualTilt.value)
self.browser.fill('anchor_type', AnchorType.OMG_PowerGrip_Plus.value)
self.browser.fill('design_spectral_response', '1.5')
#with open('test/fixtures/expected_dual_tilt_big_spacing.txt', 'r', newline='') as csv_file:
with open('test/fixtures/expected_small_dual_tilt.txt', 'r', newline='') as csv_file:
csv_content = csv_file.read()
self.browser.fill('project_name', 'Test Project Name')
self.browser.fill('building_width', '450')
self.browser.fill('building_height', '35')
self.browser.fill('building_length', '500')
self.browser.fill('wind_speed', '110')
self.browser.fill('exposure_category', 'B')
self.browser.fill('ballast_block_weight', '14')
self.browser.fill('building_parapet_height', '5')
self.browser.fill('max_system_pressure', '10')
self.browser.fill('system_type', SystemType.dualTilt.value)
self.browser.fill('anchor_type', AnchorType.OMG_PowerGrip_Plus.value)
self.browser.fill('design_spectral_response', '1.5')
self.browser.fill('module_type', ModuleType.Cell96.value)
self.advance_n_times(1)
self.attach_file('test/fixtures/input_dual_tilt_coordinates.csv')
self.advance_n_times(1)
self.attach_file('test/fixtures/input_small_dual_tilt.csv')
self.advance_n_times(1)
self.browser.visit('/download/')
self.browser.click_link_by_partial_text('Download AutoCAD import file')
eq_(self.browser.html, csv_content)
eq_(self.browser._response.headers['Content-Disposition'], 'attachment; filename=test_project_name_result.txt')
self.advance_n_times(1)
self.browser.visit('/download/')
self.browser.click_link_by_partial_text('Download AutoCAD import file')
eq_(self.browser.html, csv_content)
eq_(self.browser._response.headers['Content-Disposition'], 'attachment; filename=test_project_name_result.txt')
# def test_uploading_dxf_and_downloading_csv(self):
# self.browser.fill('project_name', 'Test Project Name')