Beispiel #1
0
 def test_site_facility_1(self):
     self.input_dict['project_size_megawatts'] = 100
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(928000.0, self.output_dict['site_facility_usd'])
Beispiel #2
0
 def test_total_management_cost(self):
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(55802284,
                      round(self.output_dict['total_management_cost']))
Beispiel #3
0
 def test_engineering_over_or_equal_200(self):
     self.input_dict['project_size_megawatts'] = 300
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(1451535, self.output_dict['engineering_usd'])
Beispiel #4
0
 def test_project_management_greater_than_28_months(self):
     self.input_dict['construction_time_months'] = 36
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(2011724,
                      round(self.output_dict['project_management_usd']))
Beispiel #5
0
 def test_bonding(self):
     """
     Test the bonding coast calculation
     """
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(1e6, self.output_dict['bonding_usd'])
Beispiel #6
0
 def test_insurance_cost(self):
     """
     Test the insurance cost calculation
     """
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(5.6e5, self.output_dict['insurance_usd'])
Beispiel #7
0
 def test_project_management_less_than_28_months(self):
     """
     Tests project management cost calculation less than 28 months.
     Ensure that the instance is set to 12 months for this calculation.
     """
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(2011724,
                      round(self.output_dict['project_management_usd']))
Beispiel #8
0
    def test_ManagementCostModule(self):
        """
        Black box test to check whether module is ran successfully or not
        """
        run_ManagementCost = ManagementCost(input_dict=self.input_dict,
                                            output_dict=self.output_dict,
                                            project_name=self.project_name)
        trial_run = run_ManagementCost.run_module()

        if trial_run[0] == 0:
            print(
                '\n\n================== MODULE EXECUTION SUCCESS =========================\n'
            )
            print(
                ' ManagementCost module ran successfully. See the list of inputs'
                '\n and outputs below used by the module in its calculations:')
            print(
                '\n=====================================================================\n'
            )

        elif trial_run[0] == 1:
            print(
                '\n\n====================================== MODULE EXECUTION FAILURE ======================================\n'
            )
            print(
                ' > ManagementCost module failed to run successfully. Error detected: ',
                trial_run[1],
                '\n > Scroll below to see detailed information about error encountered.'
                '\n > See the list of inputs below used by the module in its calculations:'
            )
            print(
                '\n========================================================================================================\n'
            )

        print(
            '\nGiven below is the set of inputs fed into ManagementCost module:\n'
        )
        for key, value in self.input_dict.items():
            if isinstance(value, pd.DataFrame):
                print(key, ':\n', value)
            else:
                print(key, ':', value)

        if trial_run[0] == 0:  # Only print outputs if module ran successfully.
            print(
                '\nGiven below is the set of outputs calculated by the RoadsCost module:\n'
            )
            for key, value in self.output_dict.items():
                if isinstance(value, pd.DataFrame):
                    print('\nNow printing DataFrame ->', key, ':\n', value)
                else:
                    print(key, ':', value)
Beispiel #9
0
 def test_engineering_under_200(self):
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(1104760.0, self.output_dict['engineering_usd'])
Beispiel #10
0
 def test_markup_contingency_costs(self):
     management_cost = ManagementCost(input_dict=self.input_dict,
                                      output_dict=self.output_dict,
                                      project_name=PROJECT_NAME)
     management_cost.run_module()
     self.assertEqual(5e7, self.output_dict['markup_contingency_usd'])