Kaydet (Commit) 7de85174 authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

Fixed history error, add test in setup file

üst 24ea419d
......@@ -68,7 +68,7 @@ class HistoryDB(lazydb.LazyDB):
for log in self.__logs:
if log.startswith("%03d_" % operation):
hist = History.History(os.path.join(ctx.config.history_dir(), log))
hist.operation.no = int(log.split("_")[0])
hist.operation.no = int(log.split("_")[0].replace("0o","0"))
return hist.operation
return None
......@@ -105,14 +105,14 @@ class HistoryDB(lazydb.LazyDB):
return
hist = History.History(os.path.join(ctx.config.history_dir(), log))
hist.operation.no = int(log.split("_")[0])
hist.operation.no = int(log.split("_")[0].replace("0o","0"))
yield hist.operation
def get_last(self, count=0):
count = count or len(self.__logs)
for log in self.__logs[:count]:
hist = History.History(os.path.join(ctx.config.history_dir(), log))
hist.operation.no = int(log.split("_")[0])
hist.operation.no = int(log.split("_")[0].replace("0o","0"))
yield hist.operation
def get_last_repo_update(self, last=1):
......
......@@ -19,6 +19,7 @@ import glob
import sys
import inspect
import tempfile
import subprocess
from distutils.core import setup
from distutils.cmd import Command
from distutils.command.build import build
......@@ -170,6 +171,21 @@ class Uninstall(Command):
print(' removing: ', project_dir)
shutil.rmtree(project_dir)
class Test(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
self.run_command('build')
os.chdir('tests')
subprocess.check_call([
sys.executable, '-bWd',
os.path.join('runTests.py')
])
datas = [
("/etc/inary/" ,["config/mirrors.conf", "config/sandbox.conf"]),
......@@ -205,7 +221,8 @@ setup(name="inary",
cmdclass = {'build' : Build,
'build_po' : BuildPo,
'install' : Install,
'uninstall' : Uninstall},
'uninstall' : Uninstall,
'test' : Test},
data_files =datas
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment