Example #1
0
 def test_configuration_illegal_types(self, key, val):
     """Illegal types for configuration values should raise
     ConfigurationError."""
     c = Configuration()
     with pytest.raises(ConfigurationError):
         c[key] = val
Example #2
0
 def test_reconfigure_backend(self):
     """backend option is read only."""
     c = Configuration()
     c.reconfigure(backend='cuda')
     with pytest.raises(ConfigurationError):
         c.reconfigure(backend='other')
Example #3
0
 def test_reconfigure_backend(self):
     """backend option is read only."""
     c = Configuration()
     c.reconfigure(backend='cuda')
     with pytest.raises(ConfigurationError):
         c.reconfigure(backend='other')
Example #4
0
 def test_add_configuration_value(self):
     """Defining an non default argument."""
     c = Configuration()
     c.reconfigure(foo='bar')
     assert c['foo'] == 'bar'
Example #5
0
 def test_add_configuration_value(self):
     """Defining an non default argument."""
     c = Configuration()
     c.reconfigure(foo='bar')
     assert c['foo'] == 'bar'