Ejemplo n.º 1
0
 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")
Ejemplo n.º 2
0
    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.")
Ejemplo n.º 3
0
 def setUp(self):
     """
     Create dict attribute that can instantiate an `SC` object
     """
     self.input_params = copy.copy(input_params)
     self.el = SC(**input_params)