示例#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""
示例#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""
示例#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
示例#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
示例#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""
示例#6
0
 def test_no_changes(self):
     no_comments = u"""def some_code():
 return False"""
     assert amc._strip_comments(no_comments) == no_comments
示例#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""
示例#8
0
 def test_no_changes(self):
     no_comments = u"""def some_code():
 return False"""
     assert amc._strip_comments(no_comments) == no_comments