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): ...@@ -68,7 +68,7 @@ class HistoryDB(lazydb.LazyDB):
for log in self.__logs: for log in self.__logs:
if log.startswith("%03d_" % operation): if log.startswith("%03d_" % operation):
hist = History.History(os.path.join(ctx.config.history_dir(), log)) 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 hist.operation
return None return None
...@@ -105,14 +105,14 @@ class HistoryDB(lazydb.LazyDB): ...@@ -105,14 +105,14 @@ class HistoryDB(lazydb.LazyDB):
return return
hist = History.History(os.path.join(ctx.config.history_dir(), log)) 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 yield hist.operation
def get_last(self, count=0): def get_last(self, count=0):
count = count or len(self.__logs) count = count or len(self.__logs)
for log in self.__logs[:count]: for log in self.__logs[:count]:
hist = History.History(os.path.join(ctx.config.history_dir(), log)) 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 yield hist.operation
def get_last_repo_update(self, last=1): def get_last_repo_update(self, last=1):
......
...@@ -19,6 +19,7 @@ import glob ...@@ -19,6 +19,7 @@ import glob
import sys import sys
import inspect import inspect
import tempfile import tempfile
import subprocess
from distutils.core import setup from distutils.core import setup
from distutils.cmd import Command from distutils.cmd import Command
from distutils.command.build import build from distutils.command.build import build
...@@ -170,6 +171,21 @@ class Uninstall(Command): ...@@ -170,6 +171,21 @@ class Uninstall(Command):
print(' removing: ', project_dir) print(' removing: ', project_dir)
shutil.rmtree(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 = [ datas = [
("/etc/inary/" ,["config/mirrors.conf", "config/sandbox.conf"]), ("/etc/inary/" ,["config/mirrors.conf", "config/sandbox.conf"]),
...@@ -205,7 +221,8 @@ setup(name="inary", ...@@ -205,7 +221,8 @@ setup(name="inary",
cmdclass = {'build' : Build, cmdclass = {'build' : Build,
'build_po' : BuildPo, 'build_po' : BuildPo,
'install' : Install, 'install' : Install,
'uninstall' : Uninstall}, 'uninstall' : Uninstall,
'test' : Test},
data_files =datas 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