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

@@ -5,6 +5,7 @@ from nose.tools import eq_
from helix.validators.csv_input_validator import CsvInputValidator
from helix.constants.system_type import SystemType
from helix.constants.module_type import ModuleType
from helix.constants.file_validation_error import FileValidationError, FileValidationMessage
@@ -94,3 +95,12 @@ class CsvInputValidatorTest(unittest.TestCase):
self.user_values.system_type.return_value = SystemType.dualTilt
cad_input = "A\tB\tC\tD\tE\r\nhandle\tblock\tA\t3\t1\r\n"
self.should_have_error(self.subject.validate(cad_input), FileValidationMessage.PanelTypeTooFewCornersDualTilt, None)
def test_reports_too_close_when_finds_panel_too_close_to_another_panel(self):
self.user_values.system_type.return_value = SystemType.dualTilt
self.user_values.module_type.return_value = ModuleType.Cell96
self.user_values.module_system_constants().tolerance = 0.1
self.user_values.module_system_constants().panel_spacing = (88.24, 62.0)
with open('test/fixtures/invalid_too_close.txt', 'r', newline='') as csv_file:
cad_input = csv_file.read()
self.should_have_error(self.subject.validate(cad_input), FileValidationMessage.PanelsTooClose , None)