• 
      

    Fix unit tests for SVN 1.6 and Python 2.6

    Review Request #7503 — Created July 8, 2015 and submitted

    Information

    RBTools
    release-0.7.x
    2fb7e92...

    Reviewers

    This patch fixes some issues with Python 2.6 compatability and using
    SVN 1.6.

    All tests using TestCase.assertIn(element, container) have been
    rewritten to use TestCase.assertTrue(element in Container). All tests
    using TestCase.assertRaises as a context manager have been rewritten
    to not use a context manager.

    The tests that operate on the output of svn diff have been modified
    to have a decorator applied to them that will supply the correct hash
    depending on the current version of SVN. This is required because SVN
    prior to 1.7 will generate a different diff.

    The aliases module has been updated to ensure that on pre Python 2.7.3
    that the command is passed as a binary string and not a unicode string.
    Support in shlex.split for unicode strings was added in Python
    2.7.3.

    Unit tests passed using all the following combinations:

    • Python 2.6, SVN 1.6
    • Python 2.6, SVN 1.8
    • Python 2.6, SVN 1.6
    • Python 2.6, SVN 1.8
    Description From Last Updated

    translated is kind of a generic name. Maybe convert_shlex_text_type? You could also assign this variable first and then use that …

    daviddavid
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          rbtools/api/tests.py
          rbtools/utils/aliases.py
          rbtools/clients/tests.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          rbtools/api/tests.py
          rbtools/utils/aliases.py
          rbtools/clients/tests.py
      
      
    2. 
        
    david
    1. 
        
    2. rbtools/utils/aliases.py (Diff revision 1)
       
       
      Show all issues

      translated is kind of a generic name. Maybe convert_shlex_text_type?

      You could also assign this variable first and then use that to check if you should call cmd.encode, which would save a line of code.

    3. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          rbtools/api/tests.py
          rbtools/utils/aliases.py
          rbtools/clients/tests.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          rbtools/api/tests.py
          rbtools/utils/aliases.py
          rbtools/clients/tests.py
      
      
    2. 
        
    david
    1. Ship It!
    2. 
        
    brennie
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-0.7.x (d16acba)