def test_get_changes(mock_method): mock_method.return_value = '''{ "stat" : "ok", "changes" : [ { "id" : 123 }, { "id" : 456 } ] }''' rbs = ReviewBoardServer('http://example.com', username='******', password='******') rb_id = 123 assert len(rbs.get_changes(rb_id)) == 2 assert mock_method.mock_calls == [ call(rbs, "api/review-requests/%d/changes/?start=0&max-results=25" % rb_id, None, None, {'Accept': 'application/json'}, method=None) ]