Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
6552b4d2
Kaydet (Commit)
6552b4d2
authored
Nis 01, 2021
tarafından
Adınız
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
test fixes
üst
23ec900e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
2 deletions
+47
-2
oo.py
inary/oo.py
+45
-0
testcase.py
tests/databaseTests/testcase.py
+1
-1
inary-index.xml
tests/inary-index.xml
+0
-0
testUtil.py
tests/inaryTests/testUtil.py
+1
-1
No files found.
inary/oo.py
0 → 100644
Dosyayı görüntüle @
6552b4d2
# -*- 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
)
tests/databaseTests/testcase.py
Dosyayı görüntüle @
6552b4d2
...
...
@@ -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
...
...
tests/inary-index.xml
deleted
100644 → 0
Dosyayı görüntüle @
23ec900e
This diff is collapsed.
Click to expand it.
tests/inaryTests/testUtil.py
Dosyayı görüntüle @
6552b4d2
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment