コード例 #1
0
ファイル: test_SC.py プロジェクト: ehsanece/tec
 def test_additional_arbitrary_args(self):
     """
     SC can be instantiated with additional arbitrary args
     """
     self.input_params["not_an_argument"] = "not_an_argument"
     try:
         el = SC(**self.input_params)
     except TypeError:
         self.fail("Instantiation failed with additional arbitrary args")
コード例 #2
0
ファイル: test_SC.py プロジェクト: ehsanece/tec
    def test_bandgap_non_numeric(self):
        """
        SC instantiation requires numeric `bandgap` value
        """
        self.input_params["bandgap"] = "this string is non-numeric."

        try:
            El = SC(**self.input_params)
        except TypeError:
            # Attempting to instantiate a `tec.electrode.SC` 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.")
コード例 #3
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)