Mercurial > p > roundup > code
comparison test/test_hyperdbvals.py @ 7212:76a21cf791b9
Add config argument for one more call
Also added Mock so it gets tested.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 04 Mar 2023 11:51:45 -0500 |
| parents | f8893e1cde0d |
| children | 978285986b2c |
comparison
equal
deleted
inserted
replaced
| 7211:506c86823abb | 7212:76a21cf791b9 |
|---|---|
| 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 | 10 |
| 11 import unittest, os, shutil, errno, sys, difflib, cgi, re | 11 import unittest, os, shutil, errno, sys, difflib, cgi, re |
| 12 from hashlib import sha1 | 12 from hashlib import sha1 |
| 13 from mock import Mock | |
| 13 | 14 |
| 14 from roundup import init, instance, password, hyperdb, date | 15 from roundup import init, instance, password, hyperdb, date |
| 15 | 16 |
| 16 class TestClass: | 17 class TestClass: |
| 17 def getprops(self): | 18 def getprops(self): |
| 55 | 56 |
| 56 class TestDatabase: | 57 class TestDatabase: |
| 57 classes = {'test': TestClass(), 'test2': TestClass2()} | 58 classes = {'test': TestClass(), 'test2': TestClass2()} |
| 58 def getUserTimezone(self): | 59 def getUserTimezone(self): |
| 59 return 0 | 60 return 0 |
| 61 config = Mock(PASSWORD_PBKDF2_DEFAULT_ROUNDS = 1000) | |
| 60 | 62 |
| 61 class RawToHyperdbTest(unittest.TestCase): | 63 class RawToHyperdbTest(unittest.TestCase): |
| 62 def _test(self, propname, value, itemid=None): | 64 def _test(self, propname, value, itemid=None): |
| 63 return hyperdb.rawToHyperdb(TestDatabase(), TestClass(), itemid, | 65 return hyperdb.rawToHyperdb(TestDatabase(), TestClass(), itemid, |
| 64 propname, value) | 66 propname, value) |
