Exemplo n.º 1
0
    def test_all_whitespace(self):
        # Note: Do not remove the spaces on the blank lines below.  They're
        # test data to show that the lines get removed despite having spaces
        # on them
        all_whitespace = u"""
              

                
\t\t\r\n
            """  # nopep8
        assert amc._strip_comments(all_whitespace) == u""
Exemplo n.º 2
0
    def test_all_whitespace(self):
        # Note: Do not remove the spaces on the blank lines below.  They're
        # test data to show that the lines get removed despite having spaces
        # on them
        all_whitespace = u"""
              

                
\t\t\r\n
            """  # nopep8
        assert amc._strip_comments(all_whitespace) == u""
Exemplo n.º 3
0
    def test_somewhat_normal(self):
        mixed = u"""#!/usr/bin/python

# here we go
def test(arg):
    # this is a thing
    thing = '# test'
    return thing
# End
"""
        mixed_results = u"""def test(arg):
    thing = '# test'
    return thing"""
        assert amc._strip_comments(mixed) == mixed_results
Exemplo n.º 4
0
    def test_somewhat_normal(self):
        mixed = u"""#!/usr/bin/python

# here we go
def test(arg):
    # this is a thing
    thing = '# test'
    return thing
# End
"""
        mixed_results = u"""def test(arg):
    thing = '# test'
    return thing"""
        assert amc._strip_comments(mixed) == mixed_results
Exemplo n.º 5
0
 def test_all_comments(self):
     all_comments = u"""# This is a test
         # Being as it is
         # To be
         """
     assert amc._strip_comments(all_comments) == u""
Exemplo n.º 6
0
 def test_no_changes(self):
     no_comments = u"""def some_code():
 return False"""
     assert amc._strip_comments(no_comments) == no_comments
Exemplo n.º 7
0
 def test_all_comments(self):
     all_comments = u"""# This is a test
         # Being as it is
         # To be
         """
     assert amc._strip_comments(all_comments) == u""
Exemplo n.º 8
0
 def test_no_changes(self):
     no_comments = u"""def some_code():
 return False"""
     assert amc._strip_comments(no_comments) == no_comments