-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kernel info and timezone info #127
Add kernel info and timezone info #127
Conversation
/lgtm |
@lukas-bednar please approve |
out = self._exec_command( | ||
cmd=cmd, err_msg="Failed to obta kernel info" | ||
) | ||
Kernel = namedtuple('Kernel', values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kernel, should be all lowercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made it from capital just to be aligned with already existing code (see Distribution in get_distribution method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, but I guess @lukas-bednar should decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is alright. namedtuple
returns a class, and then you create instance of that class. And classes in python should be Uppercased.
out = self._exec_command( | ||
cmd=cmd, err_msg="Failed to obtain timezone info" | ||
) | ||
Timezone = namedtuple('Timezone', values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it looks good to me.
Please add tests which covers new functionality.
Codecov Report
@@ Coverage Diff @@
## master #127 +/- ##
==========================================
+ Coverage 79.54% 79.78% +0.24%
==========================================
Files 19 19
Lines 1843 1865 +22
==========================================
+ Hits 1466 1488 +22
Misses 377 377
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I am just not sure about relevance of negative test-cases.
tests/test_os.py
Outdated
@@ -95,6 +110,8 @@ class TestOperatingSystemNegative(object): | |||
), | |||
'python -c "import platform;print(\',\'.join(' | |||
'platform.linux_distribution()))"': (1, '', 'SyntaxError'), | |||
'uname -r ; uname -v ; uname -m': (1, '', 'SyntaxError'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that uname
or date
command can raise any SyntaxError
, so I believe that these tests are redundant here.
You can either remove them, or think about something more likely happening for these two commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
Add kernel (release, version, type) and timezone (name, offset) info.