Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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ç
Batuhan Osman TASKAYA
cpython
Commits
23cc8c0f
Unverified
Kaydet (Commit)
23cc8c0f
authored
Kas 29, 2017
tarafından
Barry Warsaw
Kaydeden (comit)
GitHub
Kas 29, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[3.6] bpo-32107 - Backport bitmask check fix (GH-4576) (#4591)
Remove a flakey test and rewrite another one for readability.
üst
b0df7862
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
test_uuid.py
Lib/test/test_uuid.py
+12
-14
No files found.
Lib/test/test_uuid.py
Dosyayı görüntüle @
23cc8c0f
...
@@ -438,59 +438,57 @@ eth0 Link encap:Ethernet HWaddr 12:34:56:78:90:ab
...
@@ -438,59 +438,57 @@ eth0 Link encap:Ethernet HWaddr 12:34:56:78:90:ab
self
.
assertEqual
(
mac
,
0x1234567890ab
)
self
.
assertEqual
(
mac
,
0x1234567890ab
)
def
check_node
(
self
,
node
,
requires
=
None
,
network
=
False
):
def
check_node
(
self
,
node
,
requires
=
None
):
if
requires
and
node
is
None
:
if
requires
and
node
is
None
:
self
.
skipTest
(
'requires '
+
requires
)
self
.
skipTest
(
'requires '
+
requires
)
hex
=
'
%012
x'
%
node
hex
=
'
%012
x'
%
node
if
support
.
verbose
>=
2
:
if
support
.
verbose
>=
2
:
print
(
hex
,
end
=
' '
)
print
(
hex
,
end
=
' '
)
if
network
:
# 47 bit will never be set in IEEE 802 addresses obtained
# from network cards.
self
.
assertFalse
(
node
&
0x010000000000
,
hex
)
self
.
assertTrue
(
0
<
node
<
(
1
<<
48
),
self
.
assertTrue
(
0
<
node
<
(
1
<<
48
),
"
%
s is not an RFC 4122 node ID"
%
hex
)
"
%
s is not an RFC 4122 node ID"
%
hex
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_ifconfig_getnode
(
self
):
def
test_ifconfig_getnode
(
self
):
node
=
uuid
.
_ifconfig_getnode
()
node
=
uuid
.
_ifconfig_getnode
()
self
.
check_node
(
node
,
'ifconfig'
,
True
)
self
.
check_node
(
node
,
'ifconfig'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_ip_getnode
(
self
):
def
test_ip_getnode
(
self
):
node
=
uuid
.
_ip_getnode
()
node
=
uuid
.
_ip_getnode
()
self
.
check_node
(
node
,
'ip'
,
True
)
self
.
check_node
(
node
,
'ip'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_arp_getnode
(
self
):
def
test_arp_getnode
(
self
):
node
=
uuid
.
_arp_getnode
()
node
=
uuid
.
_arp_getnode
()
self
.
check_node
(
node
,
'arp'
,
True
)
self
.
check_node
(
node
,
'arp'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_lanscan_getnode
(
self
):
def
test_lanscan_getnode
(
self
):
node
=
uuid
.
_lanscan_getnode
()
node
=
uuid
.
_lanscan_getnode
()
self
.
check_node
(
node
,
'lanscan'
,
True
)
self
.
check_node
(
node
,
'lanscan'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
def
test_netstat_getnode
(
self
):
def
test_netstat_getnode
(
self
):
node
=
uuid
.
_netstat_getnode
()
node
=
uuid
.
_netstat_getnode
()
self
.
check_node
(
node
,
'netstat'
,
True
)
self
.
check_node
(
node
,
'netstat'
)
@unittest.skipUnless
(
os
.
name
==
'nt'
,
'requires Windows'
)
@unittest.skipUnless
(
os
.
name
==
'nt'
,
'requires Windows'
)
def
test_ipconfig_getnode
(
self
):
def
test_ipconfig_getnode
(
self
):
node
=
uuid
.
_ipconfig_getnode
()
node
=
uuid
.
_ipconfig_getnode
()
self
.
check_node
(
node
,
'ipconfig'
,
True
)
self
.
check_node
(
node
,
'ipconfig'
)
@unittest.skipUnless
(
importable
(
'win32wnet'
),
'requires win32wnet'
)
@unittest.skipUnless
(
importable
(
'win32wnet'
),
'requires win32wnet'
)
@unittest.skipUnless
(
importable
(
'netbios'
),
'requires netbios'
)
@unittest.skipUnless
(
importable
(
'netbios'
),
'requires netbios'
)
def
test_netbios_getnode
(
self
):
def
test_netbios_getnode
(
self
):
node
=
uuid
.
_netbios_getnode
()
node
=
uuid
.
_netbios_getnode
()
self
.
check_node
(
node
,
network
=
True
)
self
.
check_node
(
node
)
def
test_random_getnode
(
self
):
def
test_random_getnode
(
self
):
node
=
uuid
.
_random_getnode
()
node
=
uuid
.
_random_getnode
()
# Least significant bit of first octet must be set.
# The multicast bit, i.e. the least significant bit of first octet,
self
.
assertTrue
(
node
&
0x010000000000
,
'
%012
x'
%
node
)
# must be set for randomly generated MAC addresses. See RFC 4122,
# $4.1.6.
self
.
assertTrue
(
node
&
(
1
<<
40
),
'
%012
x'
%
node
)
self
.
check_node
(
node
)
self
.
check_node
(
node
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
@unittest.skipUnless
(
os
.
name
==
'posix'
,
'requires Posix'
)
...
...
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