def test_graph_exception():
		print("	Testing the graph_exception class/module.")
		prompt = "	... Test: Raise graph_exception		{}"
		statistical_analysis.increment_number_test_cases_used()
		try (config_manager.get_result_repository() == "Unknown location."):
			print(prompt .format("OK"))
			statistical_analysis.increment_number_test_cases_passed()
		try (config_manager.get_result_repository() == "Unknown location."):
			print(prompt .format("OK"))
			statistical_analysis.increment_number_test_cases_passed()
		except graph_exception:
			print(prompt .format("FAIL!!!"))
			#print("location=",config_manager.get_result_repository(),"=")
		except:
			print(prompt .format("FAIL fail!!!"))
		absolute_path = "/Users/zhiyang/Documents/ricerca/risultati_sperimentali/std-cell-library-characterization"
		prompt = "	... Test: result_repository, check change to abs. path.	{}"
		statistical_analysis.increment_number_test_cases_used()
		if config_manager.set_result_repository(absolute_path):
			print("	result_repository is changed to an absolute path.")
		else:
			print("	result_repository is NOT changed to an absolute path.")
		if (config_manager.get_result_repository() == absolute_path):
			print(prompt .format("OK"))
			statistical_analysis.increment_number_test_cases_passed()
		else:
			print(prompt .format("FAIL!!!"))
			print("Actual location=",config_manager.get_result_repository(),"=")
		# ------------------------------------------------------------
		prompt = "	... Test: result_repository, check change to rel. path.	{}"
		statistical_analysis.increment_number_test_cases_used()
		"""
			Set "result_repository" to a relative path that is equivalent
				absolute path, "absolute_path".
		"""
		if config_manager.set_result_repository("~/Documents/ricerca/risultati_sperimentali/std-cell-library-characterization"):
			print("	result_repository is changed to an relative path.")
		else:
Exemple #3
0
    def test_configure_sw_application_parameters():
        print("	Testing the config_manager class/module.")
        prompt = "	... Test: check default result_repository		{}"
        statistical_analysis.increment_number_test_cases_used()
        if (config_manager.get_result_repository() == "Unknown location."):
            print(prompt.format("OK"))
            statistical_analysis.increment_number_test_cases_passed()
        else:
            print(prompt.format("FAIL!!!"))
        absolute_path = "/Users/zhiyang/Documents/ricerca/risultati_sperimentali/std-cell-library-characterization"
        prompt = "	... Test: result_repository, check change to abs. path.	{}"
        statistical_analysis.increment_number_test_cases_used()
        if config_manager.set_result_repository(absolute_path):
            print("	result_repository is changed to an absolute path.")
        else:
            print("	result_repository is NOT changed to an absolute path.")
        if (config_manager.get_result_repository() == absolute_path):
            print(prompt.format("OK"))
            statistical_analysis.increment_number_test_cases_passed()
        else:
            print(prompt.format("FAIL!!!"))
            print("Actual location=", config_manager.get_result_repository(),
                  "=")
        # ------------------------------------------------------------
        prompt = "	... Test: result_repository, check change to rel. path.	{}"
        statistical_analysis.increment_number_test_cases_used()
        """
			Set "result_repository" to a relative path that is equivalent
				absolute path, "absolute_path".
		"""
        if config_manager.set_result_repository(
                "~/Documents/ricerca/risultati_sperimentali/std-cell-library-characterization"
        ):
            print("	result_repository is changed to an relative path.")
        else:
            print("	result_repository is NOT changed to an relative path.")
        """
			"result_repository" is changed to an relative path.
			However, compare "result_repository" to the equivalent
				absolute path.
			This is because if a relative path is detected, it will be
				transform/changed to an absolute path, before being
				assigned to "result_repository".
		"""
        if (config_manager.get_result_repository() == absolute_path):
            print(prompt.format("OK"))
            statistical_analysis.increment_number_test_cases_passed()
        else:
            print(prompt.format("FAIL!!!"))
            print("Actual location=", config_manager.get_result_repository(),
                  "=")
        # ------------------------------------------------------------
        prompt = "	... Test: result_repository, changing to invalid path.	{}"
        statistical_analysis.increment_number_test_cases_used()
        """
			Set "result_repository" to an invalid path.
		"""
        if not config_manager.set_result_repository(
                "~/This/is/an/invalid/path"):
            print("	result_repository is not changed to an invalid path.")
        else:
            print("	result_repository is CHANGED to an INVALID path.")
        """
			"result_repository" should not be changed to an invalid path.
			Hence, it shall still refer to "absolute_path".
		"""
        if (config_manager.get_result_repository() == absolute_path):
            print(prompt.format("OK"))
            statistical_analysis.increment_number_test_cases_passed()
        else:
            print(prompt.format("FAIL!!!"))
            print("Actual location=", config_manager.get_result_repository(),
                  "=")