new tests for parts removal
This commit is contained in:
@@ -666,6 +666,56 @@ class EbomCalculatorTest(unittest.TestCase):
|
|||||||
|
|
||||||
assert_dictionary_equal(self.subject.compute_ebom(), expected_output)
|
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):
|
def test_computes_ebom_with_aux_plugs_on_switchgear_on_pseries_single_tilt(self):
|
||||||
self.user_values.power_stations.return_value = [
|
self.user_values.power_stations.return_value = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user