Mercurial > p > roundup > code
comparison test/rest_common.py @ 6361:58817c3bf471
Fix roundup/test
Move the test-detectors in tx_Source_detector.py to roundup/test for two
reasons: It's used in the memorydb convenience functions and it may be
useful in other tests. Make the prefix a paramter of the convenience
functions to be usable in other tests.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Tue, 30 Mar 2021 14:16:28 +0200 |
| parents | 6a69584d117e |
| children | f2c31f5ec50b |
comparison
equal
deleted
inserted
replaced
| 6360:a77a7d04ed23 | 6361:58817c3bf471 |
|---|---|
| 5 import errno | 5 import errno |
| 6 import cgi | 6 import cgi |
| 7 | 7 |
| 8 from time import sleep | 8 from time import sleep |
| 9 from datetime import datetime, timedelta | 9 from datetime import datetime, timedelta |
| 10 from roundup.test.tx_Source_detector import init as tx_Source_init | |
| 10 | 11 |
| 11 try: | 12 try: |
| 12 from datetime import timezone | 13 from datetime import timezone |
| 13 myutc = timezone.utc | 14 myutc = timezone.utc |
| 14 except ImportError: | 15 except ImportError: |
| 228 self.db.user.addprop(issue=hyperdb.Link('issue')) | 229 self.db.user.addprop(issue=hyperdb.Link('issue')) |
| 229 self.db.msg.addprop(tx_Source=hyperdb.String()) | 230 self.db.msg.addprop(tx_Source=hyperdb.String()) |
| 230 | 231 |
| 231 self.db.post_init() | 232 self.db.post_init() |
| 232 | 233 |
| 233 thisdir = os.path.dirname(__file__) | 234 tx_Source_init(self.db) |
| 234 vars = {} | |
| 235 with open(os.path.join(thisdir, "tx_Source_detector.py")) as f: | |
| 236 code = compile(f.read(), "tx_Source_detector.py", "exec") | |
| 237 exec(code, vars) | |
| 238 vars['init'](self.db) | |
| 239 | 235 |
| 240 env = { | 236 env = { |
| 241 'PATH_INFO': 'http://localhost/rounduptest/rest/', | 237 'PATH_INFO': 'http://localhost/rounduptest/rest/', |
| 242 'HTTP_HOST': 'localhost', | 238 'HTTP_HOST': 'localhost', |
| 243 'TRACKER_NAME': 'rounduptest' | 239 'TRACKER_NAME': 'rounduptest' |
