Kaydet (Commit) 6552b4d2 authored tarafından Adınız's avatar Adınız

test fixes

üst 23ec900e
# -*- coding: utf-8 -*-
#
# Guido's cool metaclass examples. fair use. ahahah.
# I find these quite handy. Use them :)
class autoprop(type):
def __init__(cls, name, bases, dict):
super(autoprop, cls).__init__(name, bases, dict)
props = {}
for name in list(dict.keys()):
if name.startswith("_get_") or name.startswith("_set_"):
props[name[5:]] = 1
for name in list(props.keys()):
fget = getattr(cls, "_get_{}".format(name), None)
fset = getattr(cls, "_set_{}".format(name), None)
setattr(cls, name, property(fget, fset))
class autosuper(type):
def __init__(cls, name, bases, dict):
super(autosuper, cls).__init__(name, bases, dict)
setattr(cls, "_{}__super".format(name), super(cls))
class autosuprop(autosuper, autoprop):
pass
class autoeq(type):
"""useful for structures"""
def __init__(cls, name, bases, dict):
super(autoeq, cls).__init__(name, bases, dict)
def equal(self, other):
return self.__dict__ == other.__dict__
cls.__eq__ = equal
class Struct(metaclass=autoeq):
def __init__(self, **entries):
self.__dict__.update(entries)
......@@ -13,7 +13,7 @@ class TestCase(unittest.TestCase):
options = inary.config.Options()
options.destdir = 'tests/tmp_root'
inary.api.set_options(options)
inary.api.set_scom(False)
#inary.api.set_scom(False)
ctx.config.values.general.distribution = "Sulin"
ctx.config.values.general.distribution_release = "2019"
ctx.config.values.general.ignore_safety = True
......
This diff is collapsed.
......@@ -47,7 +47,7 @@ class UtilTestCase(unittest.TestCase):
# file/directory related functions tests
def testCheckFile(self):
assert check_file('/usr/bin/bash')
assert check_file('/bin/bash')
try:
check_file('/usr/bin/aatests')
except BaseException:
......
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