This is pretty much a line by line translation of the existing python tests, with two new tests for the count API.