From b610d2956cd0bc0b59ab1215612dc5867055deeb Mon Sep 17 00:00:00 2001 From: GotPPay Date: Fri, 17 Nov 2017 23:27:50 +0100 Subject: [PATCH 1/3] include rj45 with delta systems monitors ; tests --- helix/user_values.py | 1 + test/calculators/calculator_test.py | 2 -- test/calculators/ebom_calculator_test.py | 13 ++++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/helix/user_values.py b/helix/user_values.py index 477ad15..bb43668 100644 --- a/helix/user_values.py +++ b/helix/user_values.py @@ -10,6 +10,7 @@ from helix.models.coordinate import Coordinate from helix.models.panel import PanelData, Panel from helix.models.sql.inverter_brands import InverterBrand + class UserValues(object): def __init__(self, store, site): self.store = store diff --git a/test/calculators/calculator_test.py b/test/calculators/calculator_test.py index 78c6423..17053e5 100644 --- a/test/calculators/calculator_test.py +++ b/test/calculators/calculator_test.py @@ -491,8 +491,6 @@ class CalculatorTest(unittest.TestCase): assert_array_equal(sorted(self.subject.documentation_bom()), sorted(expected)) - # Performance Tests - def test_performance_with_1000ish_module_site(self): store = Store(mockredis.mock_redis_client(), "foo") diff --git a/test/calculators/ebom_calculator_test.py b/test/calculators/ebom_calculator_test.py index 271c3b4..d7ee1a6 100644 --- a/test/calculators/ebom_calculator_test.py +++ b/test/calculators/ebom_calculator_test.py @@ -1111,13 +1111,24 @@ class EbomCalculatorTest(unittest.TestCase): self.user_values.system_type.return_value = SystemType.singleTilt self.user_values.module_type.return_value = ModuleType.Cell96 + expected_output = { monitor_power_plug: 1, stump: 0, cable_support: 0, cable_support_lid: 0, rear_skirt: 0, - monitor_controller_480_v: 1, + monitor_controller_480_v:1, + flat_washer: 4, + channel_nut: 4, + hex_nut_three_eighths_16: 2, + front_legs: 1, + back_legs: 1, + inverter_link: 2, + inverter_rail: 1, + rubber_foot: 3, + hex_bolt_1_2: 9, + mounting_back_plate: 1, ethernet_plug: 2, } -- 2.47.3 From 8d0daa11d19616695a19bff43e7ca70581b29abf Mon Sep 17 00:00:00 2001 From: GotPPay Date: Mon, 27 Nov 2017 22:05:45 +0100 Subject: [PATCH 2/3] fix after rebase --- test/calculators/ebom_calculator_test.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/test/calculators/ebom_calculator_test.py b/test/calculators/ebom_calculator_test.py index d7ee1a6..80c0078 100644 --- a/test/calculators/ebom_calculator_test.py +++ b/test/calculators/ebom_calculator_test.py @@ -1118,17 +1118,7 @@ class EbomCalculatorTest(unittest.TestCase): cable_support: 0, cable_support_lid: 0, rear_skirt: 0, - monitor_controller_480_v:1, - flat_washer: 4, - channel_nut: 4, - hex_nut_three_eighths_16: 2, - front_legs: 1, - back_legs: 1, - inverter_link: 2, - inverter_rail: 1, - rubber_foot: 3, - hex_bolt_1_2: 9, - mounting_back_plate: 1, + monitor_controller_480_v: 1, ethernet_plug: 2, } -- 2.47.3 From 8ffa98557f4582dab90e459343ad48a8355f210e Mon Sep 17 00:00:00 2001 From: GotPPay Date: Mon, 4 Dec 2017 22:40:12 +0100 Subject: [PATCH 3/3] restore to previous functionality --- helix/calculators/ebom_calculator.py | 2 -- test/calculators/ebom_calculator_test.py | 1 - 2 files changed, 3 deletions(-) diff --git a/helix/calculators/ebom_calculator.py b/helix/calculators/ebom_calculator.py index e9113af..f79bf97 100644 --- a/helix/calculators/ebom_calculator.py +++ b/helix/calculators/ebom_calculator.py @@ -91,8 +91,6 @@ class EbomCalculator(object): for monitor in monitors: if monitor['power_source'][0] == 'Switch Gear/External': add_parts_to_list(part_list, {proper_monitor_controller: 1}, 1) - if (is_delta): - add_parts_to_list(part_list, {ethernet_plug: 2},1) add_parts_to_list(part_list, {wire_clip_large: inverter_count}, self.row_count) diff --git a/test/calculators/ebom_calculator_test.py b/test/calculators/ebom_calculator_test.py index 80c0078..f394799 100644 --- a/test/calculators/ebom_calculator_test.py +++ b/test/calculators/ebom_calculator_test.py @@ -1119,7 +1119,6 @@ class EbomCalculatorTest(unittest.TestCase): cable_support_lid: 0, rear_skirt: 0, monitor_controller_480_v: 1, - ethernet_plug: 2, } assert_dictionary_equal(self.subject.compute_ebom(), expected_output) -- 2.47.3