diff --git a/pike/__init__.py b/pike/__init__.py index 47bfcbf9..880200c8 100644 --- a/pike/__init__.py +++ b/pike/__init__.py @@ -13,5 +13,5 @@ 'test', 'transport', ] -__version_info__ = (0, 2, 11) +__version_info__ = (0, 2, 12) __version__ = "{0}.{1}.{2}".format(*__version_info__) diff --git a/pike/test/credit.py b/pike/test/credit.py index 5351920e..ec267d25 100644 --- a/pike/test/credit.py +++ b/pike/test/credit.py @@ -398,9 +398,18 @@ def test_sequence_number_wrap(self): # build up the sequence number to the target while chan1.connection._next_mid < sequence_number_target: smb_req = chan1.write_request(fh1, 0, buf*credits_per_req).parent - smb_resp = chan1.connection.submit(smb_req.parent)[0].result() + smb_future = chan1.connection.submit(smb_req.parent)[0] + smb_resp = smb_future.result() + if smb_future.interim_response: + # if server granted credits on interim + self.assertEqual(smb_future.interim_response.credit_response, + credits_per_req) + # then server should grant 0 credits on final resp + self.assertEqual(smb_resp.credit_response, 0) + else: + # otherwise, all credits should be granted in final response + self.assertEqual(smb_resp.credit_response, credits_per_req) # if the server is granting our request, - self.assertEqual(smb_resp.credit_response, credits_per_req) # then total number of credits should stay the same self.assertEqual(chan1.connection.credits, exp_credits)