예제 #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
예제 #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')
예제 #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')
예제 #4
0
 def test_add_configuration_value(self):
     """Defining an non default argument."""
     c = Configuration()
     c.reconfigure(foo='bar')
     assert c['foo'] == 'bar'
예제 #5
0
 def test_add_configuration_value(self):
     """Defining an non default argument."""
     c = Configuration()
     c.reconfigure(foo='bar')
     assert c['foo'] == 'bar'