Repository: PyBites-Open-Source/search (language: python)

Issue:
Output table rendering seems to vary by OS. Test failing on Windows.
On windows, `test_show_tip_matches()` is failing on the assertion `assert strip_ansi(output.strip()) == EXPECTED_TABLE.strip()`

The output characters rich is using to build the table borders don't match with the ones in `EXPECTED_TABLE`:

```
    def test_show_tip_matches(mock_data, capfd):
        mock_response = requests.Response()
        mock_response.status_code = 200
        mock_response._content = json.dumps(mock_data).encode()

        with patch("requests.get", return_value=mock_response):
            searcher = TipSearch()
            results = searcher.match_content(" a")
            searcher.show_matches(results)
            output = capfd.readouterr()[0]
>           assert strip_ansi(output.strip()) == EXPECTED_TABLE.strip()
E           AssertionError: assert '┌───────────...────────────┘' == '┏━━━━━━━━━━━...────────────┘'
E             - ┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
E             + ┌────────────────────┬─────────────────────────────────────────────────┐
E             - ┃ Title              ┃ Url                                             ┃
E             ? ^                    ^                                                 ^
E             + │ Title              │ Url                                             │
E             ? ^                    ^                                                 ^
E             - ┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩...
E
E             ...Full output truncated (4 lines hidden), use '-vv' to show

tests\test_tip.py:65: AssertionError
```



Discussion / hints:
@greywidget you mind quickly shooting through a PR? maybe we can use a len() on the table rows and some regex to test what's in the table rather? I don't care about the borders per se :) - thanks. I would fix it but not having Windows I cannot reproduce it. I did log an issue to get GH Actions to test Windows from here on ... (I can work on that in later today)  

Fix patch:
diff --git a/.gitignore b/.gitignore
index b18df2a..dc08b35 100644
--- a/.gitignore
+++ b/.gitignore
@@ -159,3 +159,6 @@ cython_debug/
 #  and can be added to the global gitignore or merged into this file.  For a more nuclear
 #  option (not recommended) you can uncomment the following to ignore the entire idea folder.
 #.idea/
+
+# isort configuration
+.isort.cfg


Test patch:
diff --git a/tests/test_tip.py b/tests/test_tip.py
index f6a6833..3935248 100644
--- a/tests/test_tip.py
+++ b/tests/test_tip.py
@@ -7,15 +7,6 @@
 
 from pybites_search.tip import ContentPiece, TipSearch
 
-EXPECTED_TABLE = """
-┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
-┃ Title              ┃ Url                                             ┃
-┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
-│ import antigravity │ https://codechalleng.es/tips/import-antigravity │
-│ for ... else       │ https://codechalleng.es/tips/for-else           │
-└────────────────────┴─────────────────────────────────────────────────┘
-"""
-
 
 @pytest.fixture
 def mock_data():
@@ -56,13 +47,21 @@ def test_show_tip_matches(mock_data, capfd):
     mock_response = requests.Response()
     mock_response.status_code = 200
     mock_response._content = json.dumps(mock_data).encode()
+    expected_output_text = []
 
     with patch("requests.get", return_value=mock_response):
         searcher = TipSearch()
-        results = searcher.match_content(" a")
+        search_term = " a"
+        for tip in mock_data:
+            if search_term in (tip["title"] + tip["description"]):
+                expected_output_text.append(tip["title"])
+                expected_output_text.append(tip["link"])
+
+        results = searcher.match_content(search_term)
+
         searcher.show_matches(results)
         output = capfd.readouterr()[0]
-        assert strip_ansi(output.strip()) == EXPECTED_TABLE.strip()
+        assert all(text in output for text in expected_output_text)
 
         results = searcher.match_content("bogus")
         searcher.show_matches(results)