示例#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'})