We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 177ab1c commit 19dbd66Copy full SHA for 19dbd66
pypgstac/tests/test_load.py
@@ -0,0 +1,22 @@
1
+import asyncio
2
+from pathlib import Path
3
+import unittest
4
+
5
+from pypgstac.pypgstac import load_ndjson, loadopt, tables
6
7
+HERE = Path(__file__).parent
8
+TEST_DATA_DIR = HERE.parent.parent / "test" / "testdata"
9
+TEST_COLLECTIONS = TEST_DATA_DIR / "collections.ndjson"
10
+TEST_ITEMS = TEST_DATA_DIR / "items.ndjson"
11
12
13
+class LoadTest(unittest.TestCase):
14
+ def test_load_testdata_succeeds(self) -> None:
15
+ asyncio.run(
16
+ load_ndjson(
17
+ str(TEST_COLLECTIONS), table=tables.collections, method=loadopt.upsert
18
+ )
19
20
21
+ load_ndjson(str(TEST_ITEMS), table=tables.items, method=loadopt.upsert)
22
0 commit comments