-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add session setting support for specs
This adds support for session settings for the various specs formats. These session settings will be applied by the http/pg client before the spec is executed.
- Loading branch information
Showing
9 changed files
with
77 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import os | ||
from unittest import TestCase | ||
from doctest import DocTestSuite | ||
|
||
from cr8.bench_spec import load_spec | ||
|
||
from cr8 import engine | ||
|
||
|
||
class SpecTest(TestCase): | ||
|
||
def test_session_settings_from_spec(self): | ||
spec = self.get_spec('sample.py') | ||
self.assertEqual(spec.session_settings, {'application_name': 'my_app', 'timezone': 'UTC'}) | ||
|
||
def test_session_settings_from_toml(self): | ||
spec = self.get_spec('sample.toml') | ||
self.assertEqual(spec.session_settings, {'application_name': 'my_app', 'timezone': 'UTC'}) | ||
|
||
def test_session_settings_from_json(self): | ||
spec = self.get_spec('count_countries.json') | ||
self.assertEqual(spec.session_settings, {'application_name': 'my_app', 'timezone': 'UTC'}) | ||
|
||
def get_spec(self, name): | ||
return load_spec(os.path.abspath(os.path.join(os.path.dirname(__file__), '../specs/', name))) | ||
|
||
|
||
def load_tests(loader, tests, ignore): | ||
tests.addTests(DocTestSuite(engine)) | ||
return tests |