Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
a64cb609
Commit
a64cb609
authored
Jul 03, 2012
by
Mukund Sivaraman
Browse files
[2062] Add some comments to the SysInfo unit test
parent
e26eb608
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/python/isc/sysinfo/tests/sysinfo_test.py
View file @
a64cb609
...
...
@@ -154,6 +154,8 @@ class SysInfoTest(unittest.TestCase):
if
osname
!=
'Linux'
:
return
# Save and replace existing implementations of library functions
# with mock ones for testing.
old_platform_system
=
platform
.
system
platform
.
system
=
_my_linux_platform_system
old_os_sysconf
=
os
.
sysconf
...
...
@@ -176,11 +178,16 @@ class SysInfoTest(unittest.TestCase):
self
.
assertEqual
(
4294963200
,
s
.
get_mem_swap_total
())
self
.
assertEqual
(
4095451136
,
s
.
get_mem_swap_free
())
self
.
assertEqual
(
'My Distribution'
,
s
.
get_platform_distro
())
# These test that the corresponding tools are being called (and
# no further processing is done on this data). Please see the
# implementation functions at the top of this file.
self
.
assertEqual
(
'qB2osV6vUOjqm3P/+tQ4d92xoYz8/U8P9v3KWRpNwlI=
\n
'
,
s
.
get_net_interfaces
())
self
.
assertEqual
(
'VGWAS92AlS14Pl2xqENJs5P2Ihe6Nv9g181Mu6Zz+aQ=
\n\n
XfizswwNA9NkXz6K36ZExpjV08Y5IXkHI8jjDSV+5Nc=
\n
'
,
s
.
get_net_routing_table
())
self
.
assertEqual
(
'osuxbrcc1g9VgaF4yf3FrtfodrfATrbSnjhqhuQSAs8=
\n
'
,
s
.
get_net_stats
())
self
.
assertEqual
(
'Z+w0lwa02/T+5+EIio84rrst/Dtizoz/aL9Im7J7ESA=
\n
'
,
s
.
get_net_connections
())
# Restore original implementations.
platform
.
system
=
old_platform_system
os
.
sysconf
=
old_os_sysconf
__builtins__
.
open
=
old_open
...
...
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