test: improve dbfs tests

- Remove a placeholder panic in `dbfs_test.v`.
- Improve `namedb_test.v` by using `get_from_id` to
  retrieve public keys by ID and then using `get` to
  retrieve the data associated with the public key.  This
  better reflects the intended usage and clarifies the test.

Co-authored-by: supermario <mariobassem12@gmail.com>
This commit is contained in:
Mahmoud Emad
2025-01-05 11:43:31 +02:00
parent a19480ecfd
commit 663f9f347a
2 changed files with 2 additions and 4 deletions

View File

@@ -35,8 +35,6 @@ fn test_dbfs3() {
withkeys: true
keyshashed: true
)!
panic('need other test')
}
fn dotest(mut db DB, mut dbcollection DBCollection) ! {

View File

@@ -44,8 +44,8 @@ fn test_dbname1() {
// Retrieve public keys using their unique IDs
console.print_debug('retrieve starts')
for i2, myid in ids {
retrieved_pubkey, data := ndb.get(myid)!
myid_found, data_found := ndb.getdata(retrieved_pubkey)!
retrieved_pubkey, data := ndb.get_from_id(myid)!
myid_found, data_found := ndb.get(retrieved_pubkey)!
assert myid_found == myid
assert data_found == data
tc := test_cases[i2] or {