Пример #1
0
 def test_custom_container_value_method(self):
     """ 
     Reject unsupported property types.
     """
     with self.assertRaises(ValueError):
         def fun():
             print(":)")
         containers.add_custom_container({'well_depth': fun})
Пример #2
0
    def test_custom_container_value_method(self):
        """ 
        Reject unsupported property types.
        """
        with self.assertRaises(ValueError):

            def fun():
                print(":)")

            containers.add_custom_container({'well_depth': fun})
Пример #3
0
 def test_custom_container_property(self):
     """
     Reject unknown properties.
     """
     with self.assertRaises(KeyError):
         containers.add_custom_container({'fake_key':True})
Пример #4
0
 def test_custom_container_type(self):
     """
     Enforce valid custom container type.
     """
     with self.assertRaises(KeyError):
         containers.add_custom_container({'type':'imaginary'})
Пример #5
0
 def test_custom_container_property(self):
     """
     Reject unknown properties.
     """
     with self.assertRaises(KeyError):
         containers.add_custom_container({'fake_key': True})
Пример #6
0
 def test_custom_container_type(self):
     """
     Enforce valid custom container type.
     """
     with self.assertRaises(KeyError):
         containers.add_custom_container({'type': 'imaginary'})