def test_get_from_memcache(self):
     dbconfig['sticky'] = 'stuck'
     self.assertEqual(dbconfig['sticky'], 'stuck')
     for c in Config.all():
         c.delete()
     # should be in memcache:
     self.assertEqual(dbconfig['sticky'], 'stuck')
Exemplo n.º 2
0
 def test_get_from_memcache(self):
     dbconfig['sticky'] = 'stuck'
     self.assertEqual(dbconfig['sticky'], 'stuck')
     for c in Config.all():
         c.delete()
     # should be in memcache:
     self.assertEqual(dbconfig['sticky'], 'stuck')
Exemplo n.º 3
0
    def test_warmup(self):
        dbconfig = DBConfig()
        dbconfig['foo'] = 'bar'
        assert memcache.flush_all()

        r = self.client.get('/_ah/warmup')
        self.assertEquals(r.status_code, 200)
        self.assertTasksInQueue(1, url='/api/current_playlist')
        for c in Config.all():
            c.delete()
        self.assertEqual(dbconfig['foo'], 'bar')
Exemplo n.º 4
0
    def test_warmup(self):
        dbconfig = DBConfig()
        dbconfig['foo'] = 'bar'
        assert memcache.flush_all()

        r = self.client.get('/_ah/warmup')
        self.assertEquals(r.status_code, 200)
        self.assertTasksInQueue(1, url='/api/current_playlist')
        for c in Config.all():
            c.delete()
        self.assertEqual(dbconfig['foo'], 'bar')
Exemplo n.º 5
0
 def test_load_dbconfig_into_memcache(self):
     dbconfig['one'] = '1'
     dbconfig['two'] = '2'
     dbconfig['three'] = 'three'
     assert memcache.flush_all()
     load_dbconfig_into_memcache()
     for c in Config.all():
         c.delete()
     # should be in memcache:
     self.assertEqual(dbconfig['one'], '1')
     self.assertEqual(dbconfig['two'], '2')
     self.assertEqual(dbconfig['three'], 'three')
 def test_load_dbconfig_into_memcache(self):
     dbconfig['one'] = '1'
     dbconfig['two'] = '2'
     dbconfig['three'] = 'three'
     assert memcache.flush_all()
     load_dbconfig_into_memcache()
     for c in Config.all():
         c.delete()
     # should be in memcache:
     self.assertEqual(dbconfig['one'], '1')
     self.assertEqual(dbconfig['two'], '2')
     self.assertEqual(dbconfig['three'], 'three')
Exemplo n.º 7
0
def _init_config(request):
    q = Config.all()
    if q.count(1) == 0:
        c = Config()
        c.varname = "dummy"
        c.value = "you can safely delete this after creating new var/vals"
        c.put()
        return HttpResponse("""Config initialized. You can now add new values 
            in the <a href="/_ah/admin">Datastore admin</a>.""")
    else:
        return HttpResponse("""Config does not need initialization. You can
            edit the config in the <a href="/_ah/admin">Datastore admin</a>."""
                            )
Exemplo n.º 8
0
def _init_config(request):
    q = Config.all()
    if q.count(1) == 0:
        c = Config()
        c.varname = "dummy"
        c.value = "you can safely delete this after creating new var/vals"
        c.put()
        return HttpResponse(
            """Config initialized. You can now add new values 
            in the <a href="/_ah/admin">Datastore admin</a>."""
        )
    else:
        return HttpResponse(
            """Config does not need initialization. You can
            edit the config in the <a href="/_ah/admin">Datastore admin</a>."""
        )
Exemplo n.º 9
0
 def setUp(self):
     assert memcache.flush_all()
     for c in Config.all():
         c.delete()
Exemplo n.º 10
0
 def setUp(self):
     assert memcache.flush_all()
     for c in Config.all():
         c.delete()