Problem: several tests are skipped#2452
Conversation
Solution: activate or remove tests
Codecov Report
@@ Coverage Diff @@
## master #2452 +/- ##
=========================================
+ Coverage 89.09% 90.1% +1.01%
=========================================
Files 41 41
Lines 2385 2366 -19
=========================================
+ Hits 2125 2132 +7
+ Misses 260 234 -26 |
| .sign([alice.private_key]) | ||
|
|
||
| b.store_transaction(tx) | ||
| tx_dict = copy.deepcopy(tx.to_dict()) |
There was a problem hiding this comment.
Is deepcopy really needed here? I assume store_bulk_transactions will just write the contents of tx to mongo. That should leave tx unchanged, and you can still perform the comparison in the last assert.
What breaks if you skip the deepcopy?
There was a problem hiding this comment.
Now that we use store_bulk_transactions we use mongos insert_many. Pymongo automatically inserts an _id field. So now we have more data in the tx and the assert fails.
There is a nice explanation here
| tx = Transaction.create([alice.public_key], [([alice.public_key], 1)], asset={'cycle': 'hero'}) | ||
| tx = tx.sign([alice.private_key]) | ||
| b.store_transaction(tx) | ||
| tx_dict = copy.deepcopy(tx.to_dict()) |
There was a problem hiding this comment.
Same question as above, regarding deepcopy
kansi
left a comment
There was a problem hiding this comment.
Could you please also remove store_transaction?
|
@kansi will do! |
Solution: replace it with store_bulk_transaction
|
|
||
|
|
||
| @pytest.mark.bdb | ||
| def test_store_transaction(mocker, tb, signed_create_tx, |
There was a problem hiding this comment.
Because we use the store_bulk_transactions now. I can put it in again and switch the store_transaction to store_transactions if you want
There was a problem hiding this comment.
@codegeschrei This test is also trying to assert if the transaction was appropriately split and the metadata and asset were stored in their respective collections. It would good to have this test back.
There was a problem hiding this comment.
Ok, I'll rewrite it.
Solution: undelete `test_store_transaction`
Solution: merge master and change deprecated store_transaction
Solution: activate or remove tests
#2381
test_core