Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Sep 27, 2024
1 parent ba646e7 commit 3ebb6d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/main/transaction/type.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ static int AerospikeTransaction_init(AerospikeTransaction *self, PyObject *args,
// or both must be omitted
as_txn *txn;
if ((py_reads_capacity == NULL) ^ (py_writes_capacity == NULL)) {
PyErr_SetString(
PyExc_TypeError,
"Both reads capacity and writes capacity must be specified");
PyErr_Format(PyExc_TypeError, "Both %s and %s must be specified",
kwlist[0], kwlist[1]);
goto error;
}
else if (py_reads_capacity && py_writes_capacity) {
Expand Down
8 changes: 4 additions & 4 deletions test/new_tests/test_mrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ class TestMRT:
({"reads_capacity": 256, "writes_capacity": 256}, nullcontext(), None),
(
{"reads_capacity": 256},
pytest.raises((TypeError)), "Both reads capacity and writes capacity must be specified"
pytest.raises((TypeError)), "Both reads_capacity and writes_capacity must be specified"
),
(
{"writes_capacity": 256},
pytest.raises((TypeError)), "Both reads capacity and writes capacity must be specified"
pytest.raises((TypeError)), "Both reads_capacity and writes_capacity must be specified"
),
(
{"reads_capacity": "256", "writes_capacity": 256},
pytest.raises((TypeError)), "Reads capacity must be an integer"
pytest.raises((TypeError)), "reads_capacity must be an integer"
),
(
{"reads_capacity": 256, "writes_capacity": "256"},
pytest.raises((TypeError)), "Writes capacity must be an integer"
pytest.raises((TypeError)), "writes_capacity must be an integer"
),
]
)
Expand Down

0 comments on commit 3ebb6d6

Please sign in to comment.