Skip to content

Instantly share code, notes, and snippets.

@laiso
Created January 26, 2010 11:00
Show Gist options
  • Save laiso/286742 to your computer and use it in GitHub Desktop.
Save laiso/286742 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2.5
# -*- coding: utf-8 -*-
import pikzie
#import unittest as pikzie
from core.models import User, Bookmark
class GAETestBase(pikzie.TestCase):
def setup(self):
from google.appengine.api import (
apiproxy_stub_map,
urlfetch_stub,
)
from google.appengine.api.memcache import memcache_stub
apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap()
apiproxy_stub_map.apiproxy.RegisterStub('urlfetch',
urlfetch_stub.URLFetchServiceStub())
apiproxy_stub_map.apiproxy.RegisterStub('memcache',
memcache_stub.MemcacheServiceStub())
def teardowm(self):
pass
class BookmarkTest(GAETestBase):
def test_fetch(self):
ore = User("laiso")
for f in ore.fetch_bookmark():
self.assert_true(isinstance(f, tuple))
b = Bookmark(f[0])
self.assert_true(len(b.get_title()) > 0)
self.assert_not_equal(b.get_url(), "")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment