Merge lp:~joetalbott/utah/add_testcase_docs_to_result into lp:utah
Proposed by
Joe Talbott
Status: | Merged |
---|---|
Merged at revision: | 697 |
Proposed branch: | lp:~joetalbott/utah/add_testcase_docs_to_result |
Merge into: | lp:utah |
Diff against target: |
215 lines (+105/-5) 4 files modified
utah/client/exceptions.py (+7/-0) utah/client/result.py (+5/-1) utah/client/testcase.py (+42/-4) utah/client/tests/test_testcase.py (+51/-0) |
To merge this branch: | bzr merge lp:~joetalbott/utah/add_testcase_docs_to_result |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Javier Collado (community) | Approve | ||
Joe Talbott (community) | Needs Resubmitting | ||
Review via email:
|
Description of the change
This adds the testcase documentation to the result packet.
The following fields are now required in tc_control
- dependencies
- action
- expected_results
To post a comment you must log in.
@Joe
After looking at the changes, I've got a couple of comments
- extra_info
The extra_info dictionary is created using the fields from self.{descripti on,dependencies ,action, expected_ results} , but I don't see any of those fields having a default value of being explicitly assigned. I guess, that they're set in the following line:
self.__ dict__. update( control_ data)
If control_data is not None, those fields are going to be available because of the schema validation. However, when control_data is None that line isn't executed and I'm not sure about what happens then. Is it possible to call TestCase.run in such a case? If that might happen, then an exception will be raised when those variables aren't found.
By the way, self.__dict__ is an implementation detail and updating it directly isn't considered a good practice. I think that I'd prefer to use internally self.control_ data[<field_ name>] rather than self.<field_name> to avoid the confusion I had (and others might have as well in the future) about were all those instance variables are assigned. If you like to keep using the object dictionary directly, isn't a big deal, but a comment about that could be added to the code.
An alternative code to avoid using self.__dict__ direclty would be as follows: data.iteritems( ):
for key, value in control_
setattr(self, key, value)
-static_analysis
Since you said you are interested in running static analysis in your code, I can tell you that there are two errors in testcase.py
- Line 210: W293 blank line contains whitespace
- Line 212: E303 too many blank lines (2)