def testGenerateEndpointUrl(self): """ Ensures that the URL built by the FakeFluidDB class is exactly the same (escaped etc...) as that produced by the real FluidDB class """ fake = FakeFluidDB() method = 'POST' path = ['foo/bar', 'baz', 'qux'] payload = 'fluiddb' urlargs = {'ham': 'eggs'} content_type = 'text/plain' fake(method, path, payload, urlargs, content_type) self.assertEqual('/foo%2Fbar/baz/qux', fake.reqs[0][1])
def setUp(self): self.db = FakeFluidDB() self.api = FluidApi(self.db)