# Test code for find_pairs_pt.py

import pytest
import find_pairs_pt as fp

def test_one_pair():
    assert fp.find_pairs_simple([1,9]) == [(1,9)]
    assert fp.find_pairs([1,9]) == [(1,9)]

'''
>>> find_pairs_simple([9])
    
    >>> find_pairs_simple([1,9])
    1,9
    >>> find_pairs_simple([9,1])
    9,1
    >>> find_pairs_simple([9,1,6])
    9,1
    >>> find_pairs_simple([9,6,1])
    9,1
    >>> find_pairs_simple([9,6,1,4,7])
    9,1
    6,4
    >>> find_pairs_simple([5])
    
    >>> find_pairs_simple([5,5])
    5,5
    >>> find_pairs_simple([1,3,7,5,9])
    1,9
    3,7
    >>> find_pairs_simple([1,3,7,5,9], 14)
    5,9
    >>> find_pairs_simple([13,-3,7,5,9])
    13,-3
'''    
@@ -74,16 +74,18 @@
 s fp%0D%0A%0D%0A
+%0D%0A
 def test
@@ -89,21 +89,62 @@
 est_
+n
 o
-ne
 _pair
+s
 ():%0D%0A
+    test_array = %5B9%5D%0D%0A    response = %5B%5D%0D%0A
     
@@ -171,33 +171,39 @@
 _simple(
-%5B1,9%5D) == %5B(1,9)%5D
+test_array) == response
 %0D%0A    as
@@ -225,162 +225,514 @@
 irs(
-%5B1,9%5D) == %5B(1,9)%5D%0D%0A%0D%0A'''%0D%0A%3E%3E%3E find_pairs_simple(%5B9%5D)
+test_array) == response%0D%0A%0D%0A%0D%0Adef test_one_pair():%0D%0A    test_array = %5B1,9%5D%0D%0A    response = %5B(1,9)%5D%0D%0A    assert fp.find_pairs_simple(test_array) == response%0D%0A    assert fp.find_pairs(test_array) == response%0D%0A    %0D%0A    # Same thing, order reversed %0D%0A    test_array = %5B9,1%5D
 %0D%0A   
+ 
- %0D%0A    %3E%3E%3E find_pairs_simple(%5B1,9%5D)%0D%0A    1,9%0D%0A    %3E%3E%3E find_pairs_simple(
+response = %5B(9,1)%5D%0D%0A    assert fp.find_pairs_simple(test_array) == response%0D%0A    assert fp.find_pairs(test_array) == response%0D%0A    %0D%0A    %0D%0Adef test_values_to_skip():%0D%0A    test_array = 
 %5B9,1
+,6
 %5D
-)
 %0D%0A    
+response = %5B(
 9,1
+)%5D
 %0D%0A    
-%3E%3E%3E 
+assert fp.
 find
@@ -749,35 +749,184 @@
 ple(
-%5B9,1,6%5D)%0D%0A    
+test_array) == response%0D%0A    assert fp.find_pairs(test_array) == response%0D%0A%0D%0A%0D%0Adef test_use_both_end_values():%0D%0A    test_array = %5B9,6,1%5D%0D%0A    response = %5B(
 9,1
+)%5D
 %0D%0A    
-%3E%3E%3E 
+assert fp.
 find
@@ -943,25 +943,92 @@
 ple(
-%5B9,6,1%5D)%0D%0A    9,1
+test_array) == response%0D%0A    assert fp.find_pairs(test_array) == response%0D%0A%0D%0A  %0D%0A'''
 %0D%0A  

Simplify format for test creation