From 84acf1a7353732f6a9d4afbe03f3add9de7b3ca1 Mon Sep 17 00:00:00 2001 From: Christopher Byrd Date: Wed, 3 Apr 2024 10:44:29 -0700 Subject: [PATCH] nit --- .github/workflows/main.yml | 6 +++--- tests/search_indexes/sample_index_tests.py | 22 ++++++++++------------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db61e24..f4f0024 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,14 +64,14 @@ jobs: coverage json - name: Upload coverage report as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: coverage-report path: | coverage.json .coverage - update-coverage: + check-coverage: runs-on: ubuntu-latest needs: [build] steps: @@ -90,7 +90,7 @@ jobs: echo "$baseline_coverage" > .coverage_baseline - name: Download coverage report artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: coverage-report path: . diff --git a/tests/search_indexes/sample_index_tests.py b/tests/search_indexes/sample_index_tests.py index 9548e6d..8efc712 100644 --- a/tests/search_indexes/sample_index_tests.py +++ b/tests/search_indexes/sample_index_tests.py @@ -6,21 +6,19 @@ class TestSampleIndex(ArchesTestCase): def test_prepare_index(self): - pass - # sample_index = SampleIndex(index_name="Sample Index") - # sample_index.prepare_index() + sample_index = SampleIndex(index_name="Sample Index") + sample_index.prepare_index() - # expected_index_metadata = {"mappings": {"properties": {"tile_count": {"type": "keyword"}, "graph_id": {"type": "keyword"}}}} - # self.assertEqual(sample_index.index_metadata, expected_index_metadata) + expected_index_metadata = {"mappings": {"properties": {"tile_count": {"type": "keyword"}, "graph_id": {"type": "keyword"}}}} + self.assertEqual(sample_index.index_metadata, expected_index_metadata) def test_get_documents_to_index(self): - pass - # sample_index = SampleIndex(index_name="Sample Index") + sample_index = SampleIndex(index_name="Sample Index") - # mock_resourceinstance = Mock(graph_id="test_graph_id") - # mock_tiles = [Mock(), Mock(), Mock()] # Mock tiles list + mock_resourceinstance = Mock(graph_id="test_graph_id") + mock_tiles = [Mock(), Mock(), Mock()] # Mock tiles list - # documents, doc_id = sample_index.get_documents_to_index(mock_resourceinstance, mock_tiles) + documents, doc_id = sample_index.get_documents_to_index(mock_resourceinstance, mock_tiles) - # self.assertEqual(documents, {"tile_count": len(mock_tiles), "graph_id": mock_resourceinstance.graph_id}) - # self.assertEqual(doc_id, str(mock_resourceinstance.resourceinstanceid)) + self.assertEqual(documents, {"tile_count": len(mock_tiles), "graph_id": mock_resourceinstance.graph_id}) + self.assertEqual(doc_id, str(mock_resourceinstance.resourceinstanceid)) \ No newline at end of file