Vince Spicer committed fa5eff2

Add a test for combined INIs

Comments (0)

Files changed (1)


 config_path = os.path.join(here, 'sample_configs')
 config_filename = os.path.join(config_path, 'test_config.ini')
+combined_config_filename = os.path.join(config_path, 'test_config_combine.ini')
+combined_ini_file = 'config:sample_configs/test_config_combine.ini'
 def test_config_egg():
     app = loadapp('egg:FakeApp#configed')
         '__file__': config_filename})
+def test_combined_config():
+    app = loadapp(combined_ini_file, relative_to=here, name='test1')
+    assert isinstance(app, fc.SimpleApp)
+    eq_(app.local_conf, {
+         'setting1': 'foo',
+         'setting2': 'foobar',
+         'setting3': 'helloworld',
+         'apppath': os.path.join(config_path, 'app')
+       })
+    eq_(app.global_conf, {
+        'def1': 'changed',
+        'def2': 'b',
+        'basepath': config_path,
+        'here': config_path,
+        '__file__': combined_config_filename})
 def test_main():
     app = loadapp('config:test_func.ini',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.