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)
1
Konular (issue)
1
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
4c1a99b6
Kaydet (Commit)
4c1a99b6
authored
Eki 26, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* add the metaclass test from new style classes paper
üst
d97f4e37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
ootests.py
tests/ootests.py
+39
-0
No files found.
tests/ootests.py
0 → 100644
Dosyayı görüntüle @
4c1a99b6
# Copyright (C) 2005, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import
unittest
import
os
from
pisi
import
version
from
pisi.oo
import
*
class
OOTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
pass
def
testautosuper
(
self
):
class
A
:
__metaclass__
=
autosuper
def
meth
(
self
):
return
"A"
class
B
(
A
):
def
meth
(
self
):
return
"B"
+
self
.
__super
.
meth
()
class
C
(
A
):
def
meth
(
self
):
return
"C"
+
self
.
__super
.
meth
()
class
D
(
C
,
B
):
def
meth
(
self
):
return
"D"
+
self
.
__super
.
meth
()
self
.
assert_
(
D
()
.
meth
()
==
"DCBA"
)
suite
=
unittest
.
makeSuite
(
OOTestCase
)
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