Browse Source

Fix testcase

master
Neil Booth 8 years ago
parent
commit
23c4616711
  1. 4
      server/storage.py
  2. 2
      tests/test_util.py

4
server/storage.py

@ -10,11 +10,11 @@
import os
from functools import partial
from lib.util import subclasses, increment_byte_string
import lib.util as util
def db_class(name):
'''Returns a DB engine class.'''
for db_class in subclasses(Storage):
for db_class in util.subclasses(Storage):
if db_class.__name__.lower() == name.lower():
db_class.import_module()
return db_class

2
tests/test_util.py

@ -56,4 +56,4 @@ def test_chunks():
def test_increment_byte_string():
assert util.increment_byte_string(b'1') == b'2'
assert util.increment_byte_string(b'\x01\x01') == b'\x01\x02'
assert util.increment_byte_string(b'\xff\xff') == b'\x01\x00\x00'
assert util.increment_byte_string(b'\xff\xff') == None

Loading…
Cancel
Save