syncing master
This commit is contained in:
@@ -367,7 +367,6 @@ class CalculatorTest(unittest.TestCase):
|
||||
)
|
||||
|
||||
self.site.power_stations = [power_station_1, power_station_2]
|
||||
|
||||
assert_array_equal(self.subject.compute_bom(), expected)
|
||||
|
||||
def test_documentation_bom(self):
|
||||
@@ -426,7 +425,7 @@ class CalculatorTest(unittest.TestCase):
|
||||
('512661', 2),
|
||||
('512662', 4),
|
||||
('512663', 2),
|
||||
('512676', 0),
|
||||
('523923', 0),
|
||||
('512910', 1),
|
||||
('513007', 50),
|
||||
('513299', 0),
|
||||
@@ -440,8 +439,6 @@ class CalculatorTest(unittest.TestCase):
|
||||
('513832', 0),
|
||||
('513833', 670),
|
||||
('513836', 0),
|
||||
('513841', 196),
|
||||
('513842', 196),
|
||||
('513843', 262),
|
||||
('513844', 214),
|
||||
('514056', 1000),
|
||||
@@ -455,9 +452,9 @@ class CalculatorTest(unittest.TestCase):
|
||||
('514440', 0),
|
||||
('514477', 2),
|
||||
('514478', 0),
|
||||
('514685', 0),
|
||||
('514686', 1),
|
||||
('514687', 0),
|
||||
('523924', 0),
|
||||
('523921', 1),
|
||||
('523922', 0),
|
||||
('514697', 1),
|
||||
('514698', 1),
|
||||
('514865', 50),
|
||||
@@ -480,19 +477,19 @@ class CalculatorTest(unittest.TestCase):
|
||||
('520306', 0),
|
||||
('521031', 2),
|
||||
('521363', 0),
|
||||
('521794', 0),
|
||||
('521795', 0),
|
||||
('521797', 0),
|
||||
('521798', 0),
|
||||
('522020', 0),
|
||||
('805615', 2),
|
||||
('521794', 196),
|
||||
('521795', 196),
|
||||
|
||||
('anchors', 262),
|
||||
('ballast', 6786),
|
||||
('modules', 1726)
|
||||
]
|
||||
|
||||
assert_array_equal(sorted(self.subject.documentation_bom()), expected)
|
||||
assert_array_equal(sorted(self.subject.documentation_bom()), sorted(expected))
|
||||
|
||||
# Performance Tests
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ class EbomCalculatorTest(unittest.TestCase):
|
||||
whip_tray: 19,
|
||||
ac_switch: 3,
|
||||
ac_splice_box: 2,
|
||||
ethernet_plug: 7.2,
|
||||
ethernet_plug: 12.600000000000001,
|
||||
mounting_back_plate: 23,
|
||||
sunshade_bolt: 4,
|
||||
sunshade_washer: 4,
|
||||
@@ -616,6 +616,56 @@ class EbomCalculatorTest(unittest.TestCase):
|
||||
|
||||
assert_dictionary_equal(self.subject.compute_ebom(), expected_output)
|
||||
|
||||
def test_computes_ebom_with_power_monitor_DELTA_brand(self):
|
||||
self.user_values.inverter_brands.return_value = [{'inverter_brand_id':2}]
|
||||
self.user_values.power_monitors.return_value = [{
|
||||
'monitor_id': 'foo',
|
||||
'power_source': ('Switch Gear/External', None)
|
||||
}]
|
||||
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,
|
||||
}
|
||||
|
||||
assert_dictionary_equal(self.subject.compute_ebom(), expected_output)
|
||||
|
||||
def test_computes_ebom_with_power_monitor_SMA_brand(self):
|
||||
self.user_values.inverter_brands.return_value = [{'inverter_brand_id':1}]
|
||||
self.user_values.power_monitors.return_value = [{
|
||||
'monitor_id': 'foo',
|
||||
'power_source': ('Switch Gear/External', None)
|
||||
}]
|
||||
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,
|
||||
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,
|
||||
}
|
||||
|
||||
assert_dictionary_equal(self.subject.compute_ebom(), expected_output)
|
||||
|
||||
def test_computes_ebom_with_aux_plugs_on_switchgear_on_pseries_single_tilt(self):
|
||||
self.user_values.power_stations.return_value = [
|
||||
{
|
||||
@@ -1051,3 +1101,58 @@ class EbomCalculatorTest(unittest.TestCase):
|
||||
|
||||
self.subject = EbomCalculator(self.user_values, 171, 98, 104)
|
||||
assert_dictionary_equal(self.subject.compute_ebom(), expected_output_240_pseries)
|
||||
|
||||
def test_computes_ebom_with_power_monitor_DELTA_brand(self):
|
||||
self.user_values.inverter_brands.return_value = [{'inverter_brand_id':2}]
|
||||
self.user_values.power_monitors.return_value = [{
|
||||
'monitor_id': 'foo',
|
||||
'power_source': ('Switch Gear/External', None)
|
||||
}]
|
||||
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,
|
||||
ethernet_plug: 2,
|
||||
}
|
||||
|
||||
assert_dictionary_equal(self.subject.compute_ebom(), expected_output)
|
||||
|
||||
def test_computes_ebom_with_power_monitor_SMA_brand(self):
|
||||
self.user_values.inverter_brands.return_value = [{'inverter_brand_id':1}]
|
||||
self.user_values.power_monitors.return_value = [{
|
||||
'monitor_id': 'foo',
|
||||
'power_source': ('Switch Gear/External', None)
|
||||
}]
|
||||
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,
|
||||
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,
|
||||
}
|
||||
|
||||
assert_dictionary_equal(self.subject.compute_ebom(), expected_output)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -72,8 +72,8 @@ class MechanicalBomCalculatorWhenDualTilt128CellTest(unittest.TestCase):
|
||||
expected_output = {
|
||||
wire_clip: 80,
|
||||
link_tray: 9,
|
||||
left_deflector: 10,
|
||||
right_deflector: 10,
|
||||
left_deflector_1_1: 10,
|
||||
right_deflector_1_1: 10,
|
||||
anchor_plate: 12,
|
||||
cross_tray_1_1: 3,
|
||||
dual_tilt_chassis: 26,
|
||||
@@ -98,8 +98,8 @@ class MechanicalBomCalculatorWhenDualTilt128CellTest(unittest.TestCase):
|
||||
expected_output = {
|
||||
wire_clip: 80,
|
||||
link_tray: 9,
|
||||
left_deflector: 10,
|
||||
right_deflector: 10,
|
||||
left_deflector_1_1: 10,
|
||||
right_deflector_1_1: 10,
|
||||
anchor_plate: 12,
|
||||
cross_tray_1_1: 3,
|
||||
dual_tilt_chassis: 26,
|
||||
|
||||
@@ -73,8 +73,8 @@ class MechanicalBomCalculatorWhenDualTilt96CellTest(unittest.TestCase):
|
||||
expected_output = {
|
||||
wire_clip: 80,
|
||||
link_tray: 9,
|
||||
left_deflector: 10,
|
||||
right_deflector: 10,
|
||||
left_deflector_1_1: 10,
|
||||
right_deflector_1_1: 10,
|
||||
anchor_plate: 12,
|
||||
cross_tray: 3,
|
||||
dual_tilt_chassis: 26,
|
||||
@@ -99,8 +99,8 @@ class MechanicalBomCalculatorWhenDualTilt96CellTest(unittest.TestCase):
|
||||
expected_output = {
|
||||
wire_clip: 80,
|
||||
link_tray: 18,
|
||||
left_deflector: 10,
|
||||
right_deflector: 10,
|
||||
left_deflector_1_1: 10,
|
||||
right_deflector_1_1: 10,
|
||||
anchor_plate: 12,
|
||||
cross_tray: 3,
|
||||
dual_tilt_chassis: 26,
|
||||
|
||||
@@ -93,8 +93,8 @@ class MechanicalBomCalculatorWhenSingleTilt128CellTest(unittest.TestCase):
|
||||
following_tray: 6,
|
||||
link_tray: 28,
|
||||
spoiler_1_1: 44,
|
||||
left_deflector: 11,
|
||||
right_deflector: 11,
|
||||
left_deflector_1_1: 11,
|
||||
right_deflector_1_1: 11,
|
||||
anchor_plate: 15,
|
||||
cross_tray_1_1: 5,
|
||||
rubber_foot: 4.4,
|
||||
|
||||
@@ -93,8 +93,8 @@ class MechanicalBomCalculatorWhenSingleTilt96CellTest(unittest.TestCase):
|
||||
following_tray: 25,
|
||||
link_tray: 28,
|
||||
spoiler: 44,
|
||||
left_deflector: 11,
|
||||
right_deflector: 11,
|
||||
left_deflector_1_1: 11,
|
||||
right_deflector_1_1: 11,
|
||||
anchor_plate: 15,
|
||||
cross_tray: 5,
|
||||
rubber_foot: 4.4,
|
||||
|
||||
Reference in New Issue
Block a user