Mercurial > p > roundup > code
comparison test/test_config.py @ 6359:2d42a308927b
Test trying to load missing config.ini file.
Noticed this case wasn't covered by tests. Low hanging fruit.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 30 Mar 2021 02:39:48 -0400 |
| parents | 42db48c30d31 |
| children | 08e209a7f22b |
comparison
equal
deleted
inserted
replaced
| 6358:42db48c30d31 | 6359:2d42a308927b |
|---|---|
| 418 # uppercase name passes as does tuple index for setting in web | 418 # uppercase name passes as does tuple index for setting in web |
| 419 self.assertEqual(config['WEB_COOKIE_TAKES_PRECEDENCE'], 0) | 419 self.assertEqual(config['WEB_COOKIE_TAKES_PRECEDENCE'], 0) |
| 420 self.assertEqual(config[('web','cookie_takes_precedence')], 0) | 420 self.assertEqual(config[('web','cookie_takes_precedence')], 0) |
| 421 | 421 |
| 422 | 422 |
| 423 def testLoadConfigNoConfig(self): | |
| 424 """ run load on a directory missing config.ini """ | |
| 425 | |
| 426 c = os.path.join(self.dirname, configuration.Config.INI_FILE) | |
| 427 if os.path.exists(c): | |
| 428 os.remove(c) | |
| 429 else: | |
| 430 self.assertFalse("setup failed missing config.ini") | |
| 431 | |
| 432 config = configuration.CoreConfig() | |
| 433 | |
| 434 with self.assertRaises(configuration.NoConfigError) as cm: | |
| 435 config.load(self.dirname) | |
| 436 | |
| 437 print(cm.exception) | |
| 438 self.assertEqual(cm.exception.args[0], self.dirname) | |
| 439 | |
| 423 def testInvalidIndexerValue(self): | 440 def testInvalidIndexerValue(self): |
| 424 """ Mistype native indexer. Verify exception is | 441 """ Mistype native indexer. Verify exception is |
| 425 generated. | 442 generated. |
| 426 """ | 443 """ |
| 427 | 444 |
