def test_get_subscribers(self): self.mox.StubOutWithMock(Subscriber, "find", True) Subscriber.find(None, "id", "asc", 0, 100, ["list_id-eq-1"]) self.mox.ReplayAll() self.record.get_subscribers(0, 100) self.mox.VerifyAll()
def test_static_find(self): context = self.mox.CreateMockAnything() context.make_request("subscriber", "GET", parameters={"sort": "id", "order": "asc", "offset": "1", "limit": "100"}, query=["id-gt-1", "id-lt-100"]).AndReturn( json.dumps([{"id": 1}, {"id": 2}])) self.mox.ReplayAll() records = Subscriber.find(context, "id", "asc", 1, 100, ["id-gt-1", "id-lt-100"]) self.assertEqual(2, len(records)) self.mox.VerifyAll()
def test_static_find(self): context = self.mox.CreateMockAnything() context.make_request("subscriber", "GET", parameters={ "sort": "id", "order": "asc", "offset": "1", "limit": "100" }, query=["id-gt-1", "id-lt-100"]).AndReturn( json.dumps([{ "id": 1 }, { "id": 2 }])) self.mox.ReplayAll() records = Subscriber.find(context, "id", "asc", 1, 100, ["id-gt-1", "id-lt-100"]) self.assertEqual(2, len(records)) self.mox.VerifyAll()