예제 #1
0
파일: test_SC.py 프로젝트: jrsmith3/tec
 def test_from_dict_additional_arbitrary_args(self):
     """
     SC.from_dict can be instantiated with additional arbitrary args
     """
     self.input_params["not_an_argument"] = "not_an_argument"
     try:
         el = SC.from_dict(self.input_params)
     except TypeError:
         self.fail("Instantiation failed with additional arbitrary args")
예제 #2
0
파일: test_SC.py 프로젝트: ehsanece/tec
 def test_from_dict_additional_arbitrary_args(self):
     """
     SC.from_dict can be instantiated with additional arbitrary args
     """
     self.input_params["not_an_argument"] = "not_an_argument"
     try:
         el = SC.from_dict(self.input_params)
     except TypeError:
         self.fail("Instantiation failed with additional arbitrary args")
예제 #3
0
파일: test_SC.py 프로젝트: jrsmith3/tec
    def test_from_dict_bandgap_non_numeric(self):
        """
        SC.from_dict instantiation requires numeric `bandgap` value
        """
        self.input_params["bandgap"] = "this string is non-numeric."

        try:
            El = SC.from_dict(self.input_params)
        except TypeError:
            # Attempting to instantiate a `tec.electrode.SC.from_dict` with a non-numeric `bandgap` argument raised a TypeError which is exactly what we wanted to do.
            pass
        else:
            self.fail("`bandgap` field of instantiating dict must be numeric.")
예제 #4
0
파일: test_SC.py 프로젝트: ehsanece/tec
    def test_from_dict_bandgap_non_numeric(self):
        """
        SC.from_dict instantiation requires numeric `bandgap` value
        """
        self.input_params["bandgap"] = "this string is non-numeric."

        try:
            El = SC.from_dict(self.input_params)
        except TypeError:
            # Attempting to instantiate a `tec.electrode.SC.from_dict` with a non-numeric `bandgap` argument raised a TypeError which is exactly what we wanted to do.
            pass
        else:
            self.fail("`bandgap` field of instantiating dict must be numeric.")
예제 #5
0
파일: test_SC.py 프로젝트: ehsanece/tec
    def test_acceptor_concentration_non_numeric(self):
        """
        SC instantiation requires numeric `acceptor_concentration` value
        """
        self.input_params[
            "acceptor_concentration"] = "this string is non-numeric."

        try:
            El = SC(**self.input_params)
        except TypeError:
            # Attempting to instantiate a `tec.electrode.SC` with a non-numeric `acceptor_concentration` argument raised a TypeError which is exactly what we wanted to do.
            pass
        else:
            self.fail(
                "`acceptor_concentration` field of instantiating dict must be numeric."
            )
예제 #6
0
파일: test_SC.py 프로젝트: ehsanece/tec
 def setUp(self):
     """
     Create dict attribute that can instantiate an `SC` object
     """
     self.input_params = copy.copy(input_params)
     self.el = SC(**input_params)