Mercurial > p > roundup > code
comparison test/test_demo.py @ 7912:5b47966bf6f0
issue2551334 - get test suite running under windows
Support dumbdbm on windows.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 28 Apr 2024 09:17:12 -0400 |
| parents | 5b1163dca9e1 |
| children | 618dccf7199d |
comparison
equal
deleted
inserted
replaced
| 7911:cbcd6253ebaa | 7912:5b47966bf6f0 |
|---|---|
| 1 import pytest | 1 import pytest |
| 2 import unittest | 2 import unittest |
| 3 import os, sys, shutil | 3 import os, sys, shutil |
| 4 | |
| 5 from os.path import normpath | |
| 4 | 6 |
| 5 from roundup.demo import install_demo, run_demo | 7 from roundup.demo import install_demo, run_demo |
| 6 | 8 |
| 7 import roundup.scripts.roundup_server | 9 import roundup.scripts.roundup_server |
| 8 | 10 |
| 87 with captured_output() as (out, err): | 89 with captured_output() as (out, err): |
| 88 self.run_install_demo("classic") | 90 self.run_install_demo("classic") |
| 89 self.assertIn("http://localhost:8917/demo/", out.getvalue()) | 91 self.assertIn("http://localhost:8917/demo/", out.getvalue()) |
| 90 | 92 |
| 91 # verify the default anydbm db is created | 93 # verify the default anydbm db is created |
| 92 db_file = self.home + "/db/nodes.user" | 94 db_file = self.home + normpath("/db/nodes.user") |
| 93 self.assertTrue(os.path.isfile(db_file), | 95 db_file_dumbdbm = self.home + normpath("/db/nodes.user.dir") |
| 94 "expected db file %s does not exist" % db_file) | 96 self.assertTrue(os.path.isfile(db_file) or |
| 97 os.path.isfile(db_file_dumbdbm), | |
| 98 "expected db file %s or %s does not exist" % ( | |
| 99 db_file, db_file_dumbdbm | |
| 100 )) | |
| 95 | 101 |
| 96 # verify requested template was used | 102 # verify requested template was used |
| 97 with open(self.home + "/TEMPLATE-INFO.txt", "r") as f: | 103 with open(self.home + "/TEMPLATE-INFO.txt", "r") as f: |
| 98 info_lines = f.read() | 104 info_lines = f.read() |
| 99 | 105 |
