Added tests for `parse_timestmp` of `djblets.log.views` to address missing test cases

Review Request #9504 — Created Jan. 20, 2018 and updated

Information

Djblets
master
80559c5...

Reviewers

Added tests for djblets.log.views for testing the parse_timestamp
function.

The included tests try the following cases with provided timestamp
format string:
- Empty String of '' being passed
- A string containing something other than a date ('jibberish')
- An invalid date where the month is out of bounds
('1990-55-09 22:11:30')
- A valid date input string ('1990-01-01 20:20:20')

Based most of this behavior off how parse_timestamp behaved in the
interpreter with various inputs. To be more accurate with testing
would require the default implementation for time and datetime,
which mightbe something to be considered with future changes to
python versions however but isn't required for
the scope of this project.

I ran ./tests/runtests djblets.log.tests and
./tests/runtests djblets.log and both pass along with
all other test cases.

Description From Last Updated

Your testing done should be capititalized appropriately. You can make the bits look like code with: `code`

brenniebrennie

The bug number should go in the bugs field. The bug number should not be in the summary or description.

brenniebrennie

You will want to give our guide on change descriptions a read and edit your summary and description to match. …

brenniebrennie

Can you wrap your description and testing done at 72 characters?

brenniebrennie

Testing done needs to be capitalized and should end in a period.

brenniebrennie

Needs a file-level docstring describing the module. "Unit tests for djblets.log.views" is fine.

brenniebrennie

Unnecessary.

brenniebrennie

Needs a docstring.

brenniebrennie

Needs a docstring.

brenniebrennie

Needs a docstring.

brenniebrennie

Needs a docstring. invalid_date.

brenniebrennie

valid_date (reads like validate otherwise) Also needs a docstring.

brenniebrennie

Test docstrings shouldn't end in periods because the test runner will append a "..."

daviddavid

Same heere.

daviddavid

And here.

daviddavid

And here.

daviddavid

Proper grammar should be "There aren't 55 months"

daviddavid
RO
brennie
  1. 
      
  2. Show all issues

    Your testing done should be capititalized appropriately.

    You can make the bits look like code with:

    `code`
    
  3. Show all issues

    The bug number should go in the bugs field.

    The bug number should not be in the summary or description.

  4. Show all issues

    You will want to give our guide on change descriptions a read and edit your summary and description to match. Change descriptions should be stand-alone and not require looking up a bug to find out what the change does.

    1. I think my latted change addresses this. Let me know.

    2. lattest*

  5. djblets/log/tests/test_log_views.py (Diff revision 1)
     
     
    Show all issues

    Needs a file-level docstring describing the module. "Unit tests for djblets.log.views" is fine.

    1. So add a docstring for the first line of the file?

  6. djblets/log/tests/test_log_views.py (Diff revision 1)
     
     
    Show all issues

    Unnecessary.

  7. djblets/log/tests/test_log_views.py (Diff revision 1)
     
     
    Show all issues

    Needs a docstring.

  8. djblets/log/tests/test_log_views.py (Diff revision 1)
     
     
    Show all issues

    Needs a docstring.

  9. djblets/log/tests/test_log_views.py (Diff revision 1)
     
     
    Show all issues

    Needs a docstring.

  10. djblets/log/tests/test_log_views.py (Diff revision 1)
     
     
    Show all issues

    Needs a docstring. invalid_date.

  11. djblets/log/tests/test_log_views.py (Diff revision 1)
     
     
    Show all issues

    valid_date (reads like validate otherwise)

    Also needs a docstring.

  12. 
      
RO
RO
RO
RO
brennie
  1. 
      
  2. Show all issues

    Can you wrap your description and testing done at 72 characters?

  3. Show all issues

    Testing done needs to be capitalized and should end in a period.

  4. 
      
david
  1. 
      
  2. djblets/log/tests/test_log_views.py (Diff revision 2)
     
     
    Show all issues

    Test docstrings shouldn't end in periods because the test runner will append a "..."

  3. djblets/log/tests/test_log_views.py (Diff revision 2)
     
     
    Show all issues

    Same heere.

  4. djblets/log/tests/test_log_views.py (Diff revision 2)
     
     
    Show all issues

    And here.

  5. djblets/log/tests/test_log_views.py (Diff revision 2)
     
     
    Show all issues

    And here.

  6. 
      
RO
Review request changed
Change Summary:

Address formatting, punctuation, and doctrings

Description:
~  

Added tests for djblets.log.views for testing the parse_timestamp function.

  ~

Added tests for djblets.log.views for testing the parse_timestamp

  + function.

   
~  

The included tests try the following cases with provided timestamp format string:

  ~

The included tests try the following cases with provided timestamp

  + format string:
    - Empty String of '' being passed
    - A string containing something other than a date ('jibberish')
~   - An invalid date where the month is out of bounds ('1990-55-09 22:11:30')
  ~ - An invalid date where the month is out of bounds
  + ('1990-55-09 22:11:30')
    - A valid date input string ('1990-01-01 20:20:20')

   
~  

Based most of this behavior off how parse_timestamp behaved in the interpreter with various inputs. To get more accurate testing would be testing the default implementation for time and datetime, which might be something to be considered with future changes to python version however isn't required for the scope of this project.

  ~

Based most of this behavior off how parse_timestamp behaved in the

  + interpreter with various inputs. To be more accurate with testing
  + would require the default implementation for time and datetime,
  + which mightbe something to be considered with future changes to
  + python versions however but isn't required for
  + the scope of this project.

Testing Done:
~  

ran ./tests/runtests djblets.log.tests and ./tests/runtests djblets.log and both pass along with all other test cases

  ~

I ran ./tests/runtests djblets.log.tests and

  + ./tests/runtests djblets.log and both pass along with
  + all other test cases.

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
david
  1. 
      
  2. djblets/log/tests/test_log_views.py (Diff revision 3)
     
     
    Show all issues

    Proper grammar should be "There aren't 55 months"

  3.