Tests for paper CRUD operations
| 97 | """Tests for paper CRUD operations""" |
| 98 | |
| 99 | def test_add_paper(self, test_db_path, sample_paper): |
| 100 | """Test adding a paper""" |
| 101 | import db_ops |
| 102 | db_ops.DB_PATH = test_db_path |
| 103 | |
| 104 | result = add_paper(sample_paper) |
| 105 | assert result is not None |
| 106 | assert result > 0 |
| 107 | |
| 108 | def test_add_duplicate_paper(self, test_db_path, sample_paper): |
| 109 | """Test adding duplicate paper returns None""" |
| 110 | import db_ops |
| 111 | db_ops.DB_PATH = test_db_path |
| 112 | |
| 113 | # Add first paper |
| 114 | add_paper(sample_paper) |
| 115 | |
| 116 | # Try to add duplicate |
| 117 | result = add_paper(sample_paper) |
| 118 | assert result is None |
| 119 | |
| 120 | def test_get_paper_by_arxiv(self, test_db_path, sample_paper): |
| 121 | """Test retrieving paper by arxiv_id""" |
| 122 | import db_ops |
| 123 | db_ops.DB_PATH = test_db_path |
| 124 | |
| 125 | # Add paper |
| 126 | add_paper(sample_paper) |
| 127 | |
| 128 | # Retrieve by arxiv_id |
| 129 | result = get_paper_by_arxiv(sample_paper["arxiv_id"]) |
| 130 | assert result is not None |
| 131 | assert result["arxiv_id"] == sample_paper["arxiv_id"] |
| 132 | |
| 133 | |
| 134 | class TestBehaviorLogOperations: |
| 135 | """Tests for behavior log operations""" |
| 136 | |
| 137 | def test_log_behavior(self, test_db_path): |
nothing calls this directly
no outgoing calls
no test coverage detected