cubicweb/server/test/unittest_utils.py
changeset 12567 26744ad37953
parent 12011 d2888fee6031
equal deleted inserted replaced
12566:6b3523f81f42 12567:26744ad37953
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """Tests for cubicweb.server.utils module."""
    18 """Tests for cubicweb.server.utils module."""
       
    19 
       
    20 import sched
    19 
    21 
    20 from cubicweb.devtools import testlib
    22 from cubicweb.devtools import testlib
    21 from cubicweb.server import utils
    23 from cubicweb.server import utils
    22 
    24 
    23 
    25 
    38         # accept any password for empty hashes (is it a good idea?)
    40         # accept any password for empty hashes (is it a good idea?)
    39         self.assertEqual(utils.crypt_password('xxx', ''), '')
    41         self.assertEqual(utils.crypt_password('xxx', ''), '')
    40         self.assertEqual(utils.crypt_password('yyy', ''), '')
    42         self.assertEqual(utils.crypt_password('yyy', ''), '')
    41 
    43 
    42     def test_schedule_periodic_task(self):
    44     def test_schedule_periodic_task(self):
    43         scheduler = utils.scheduler()
    45         scheduler = sched.scheduler()
    44         this = []
    46         this = []
    45 
    47 
    46         def fill_this(x):
    48         def fill_this(x):
    47             this.append(x)
    49             this.append(x)
    48             if len(this) > 2:
    50             if len(this) > 2: