Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. import pytest
  2.  
  3.  
  4. @pytest.parametrize(
  5. ['input', 'expected_output'],
  6. [
  7. # Fold in before space
  8. ("""
  9. func(a, b, c,| d, e, f)
  10. """,
  11. """
  12. func(a, b, c,
  13. |d, e, f)
  14. """),
  15. # Fold-in after space (strip?)
  16. ("""
  17. func(a, b, c, |d, e, f)
  18. """,
  19. """
  20. func(a, b, c,
  21. |d, e, f)
  22. """),
  23. # After nested fold-in
  24. ("""
  25. func(a, (b, c),|)
  26. """,
  27. """
  28. func(a, (b, c),
  29. |)
  30. """),
  31. # Block with content
  32. ("""
  33. l = [|a]
  34. """,
  35. """
  36. l = [
  37. |a
  38. ]
  39. """),
  40. ("""
  41. l = [|a, b
  42. c, d]
  43. """,
  44. """
  45. l = [
  46. |a, b
  47. c, d
  48. ]
  49. """),
  50. # Empty block
  51. ("""
  52. func(|)
  53. """,
  54. """
  55. func(
  56. |
  57. )
  58. """),
  59. # block in fold-in TOREVIEW
  60. ("""
  61. func(a, b, (|))
  62. """,
  63. """
  64. func(a, b, (
  65. |
  66. ))
  67. """),
  68. # Multiple nested fold-in brackets
  69. ("""
  70. (DC('tagsOptions', '...'),
  71. ('tagsOptions', [('IDENT', "foreground"),|
  72. """,
  73. """
  74. (DC('tagsOptions', '...'),
  75. ('tagsOptions', [('IDENT', "foreground"),
  76. |
  77. """),
  78. ("""
  79. (DC('tagsOptions', '...'),
  80. ('tagsOptions', [('IDENT', "foreground"),|]))
  81. """,
  82. """
  83. (DC('tagsOptions', '...'),
  84. ('tagsOptions', [('IDENT', "foreground"),
  85. |]))
  86. """),
  87. ("""
  88. (DC('tagsOptions', '...'),
  89. ('tagsOptions', [('IDENT', "foreground")]|))
  90. """,
  91. """
  92. (DC('tagsOptions', '...'),
  93. ('tagsOptions', [('IDENT', "foreground")]
  94. |))
  95. """),
  96. ("""
  97. (DC('tagsOptions', '...'),
  98. ('tagsOptions', [('IDENT', "foreground")])|)
  99. """,
  100. """
  101. (DC('tagsOptions', '...'),
  102. ('tagsOptions', [('IDENT', "foreground")])
  103. |)
  104. """),
  105. # Comma-aware
  106. ("""
  107. a(b + c, d |+)
  108. """,
  109. """
  110. a(b + c, d
  111. |+)
  112. """),
  113. # Nested comma-aware (with content)
  114. ("""
  115. a(b, (c, d |+))
  116. """,
  117. """
  118. a(b, (c, d
  119. |+))
  120. """),
  121. # Nested comma-aware (without content or closing brackets)
  122. ("""
  123. a(b, (c, d|
  124. """,
  125. """
  126. a(b, (c, d
  127. |
  128. """),
  129. ]
  130. )
  131. def test_(input, expected_output):
  132. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement