Collect official COLM and NeurIPS abstracts with track-aware coverage
Metadata integrity checks / metadata (push) Successful in 4s
Metadata integrity checks / metadata (push) Successful in 4s
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
from contextlib import closing
|
||||
import sqlite3
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -27,7 +28,7 @@ class ImportTests(unittest.TestCase):
|
||||
self.write([self.row('2601.00001','10.0000/example'),self.row('2601.00002','10.0000/example')])
|
||||
ingest(self.db,self.archive)
|
||||
ingest(self.db,self.archive)
|
||||
with sqlite3.connect(self.db) as c:
|
||||
with closing(sqlite3.connect(self.db)) as c, c:
|
||||
self.assertEqual(c.execute('SELECT count(*) FROM papers').fetchone()[0],1)
|
||||
self.assertEqual(c.execute('SELECT count(*) FROM source_records').fetchone()[0],2)
|
||||
self.assertEqual(c.execute("SELECT count(*) FROM papers_fts WHERE papers_fts MATCH 'Searchable'").fetchone()[0],1)
|
||||
@@ -38,18 +39,18 @@ class ImportTests(unittest.TestCase):
|
||||
def test_title_alone_does_not_merge(self):
|
||||
self.write([self.row('2601.00001'),self.row('2601.00002')])
|
||||
ingest(self.db,self.archive)
|
||||
with sqlite3.connect(self.db) as c:
|
||||
with closing(sqlite3.connect(self.db)) as c, c:
|
||||
self.assertEqual(c.execute('SELECT count(*) FROM papers').fetchone()[0],2)
|
||||
|
||||
def test_platform_and_custom_tags_remain_distinct(self):
|
||||
self.write([self.row('2601.00001')])
|
||||
ingest(self.db,self.archive)
|
||||
with sqlite3.connect(self.db) as c:
|
||||
with closing(sqlite3.connect(self.db)) as c, c:
|
||||
paper = c.execute('SELECT id FROM papers').fetchone()[0]
|
||||
tag = c.execute("INSERT INTO tags(namespace,value) VALUES('custom:topic','cs.AI')").lastrowid
|
||||
c.execute('INSERT INTO paper_tags VALUES(?,?,NULL,?)',(paper,tag,'manual:1'))
|
||||
ingest(self.db,self.archive)
|
||||
with sqlite3.connect(self.db) as c:
|
||||
with closing(sqlite3.connect(self.db)) as c, c:
|
||||
self.assertEqual(c.execute("SELECT count(*) FROM paper_tags pt JOIN tags t ON pt.tag_id=t.id WHERE t.value='cs.AI'").fetchone()[0],2)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user