def testIdentifyChannel(self):
   self.mox_obj.StubOutWithMock(chrome_channel_util, 'memcache')
   self.mox_obj.StubOutWithMock(chrome_channel_util, '_GetChannelData')
   chrome_channel_util.memcache.get(mox.IgnoreArg()).AndReturn(None)
   chrome_channel_util._GetChannelData().AndReturn(self.OMAHAPROXY_HEADER +
                                                   self.OMAHAPROXY_CSV_DATA)
   chrome_channel_util.memcache.set(mox.IgnoreArg(), mox.IgnoreArg(),
                                    time=mox.IgnoreArg()).AndReturn(None)
   self.mox_obj.ReplayAll()
   channel = chrome_channel_util.IdentifyChannel('windows', '13.0.761.0')
   self.assertEqual('canary', channel)
   self.mox_obj.VerifyAll()
示例#2
0
 def testIdentifyChannel(self):
     self.mox_obj.StubOutWithMock(chrome_channel_util, 'memcache')
     self.mox_obj.StubOutWithMock(chrome_channel_util, '_GetChannelData')
     chrome_channel_util.memcache.get(mox.IgnoreArg()).AndReturn(None)
     chrome_channel_util._GetChannelData().AndReturn(
         self.OMAHAPROXY_HEADER + self.OMAHAPROXY_CSV_DATA)
     chrome_channel_util.memcache.set(mox.IgnoreArg(),
                                      mox.IgnoreArg(),
                                      time=mox.IgnoreArg()).AndReturn(None)
     self.mox_obj.ReplayAll()
     channel = chrome_channel_util.IdentifyChannel('windows', '13.0.761.0')
     self.assertEqual('canary', channel)
     self.mox_obj.VerifyAll()
 def testGetAllChannelVersions(self):
   self.mox_obj.StubOutWithMock(chrome_channel_util, 'memcache')
   self.mox_obj.StubOutWithMock(chrome_channel_util, '_GetChannelData')
   chrome_channel_util.memcache.get(mox.IgnoreArg()).AndReturn(None)
   chrome_channel_util._GetChannelData().AndReturn(self.OMAHAPROXY_HEADER +
                                                   self.OMAHAPROXY_CSV_DATA)
   chrome_channel_util.memcache.set(mox.IgnoreArg(), mox.IgnoreArg(),
                                    time=mox.IgnoreArg()).AndReturn(None)
   self.mox_obj.ReplayAll()
   channel_info = chrome_channel_util.GetAllChannelVersions('windows')
   self.assertEqual('13.0.761.0', channel_info['canary'])
   self.assertEqual('12.0.742.30', channel_info['dev'])
   self.assertEqual('12.0.742.30', channel_info['beta'])
   self.assertEqual('11.0.696.65', channel_info['stable'])
   self.mox_obj.VerifyAll()
示例#4
0
 def testGetAllChannelVersions(self):
     self.mox_obj.StubOutWithMock(chrome_channel_util, 'memcache')
     self.mox_obj.StubOutWithMock(chrome_channel_util, '_GetChannelData')
     chrome_channel_util.memcache.get(mox.IgnoreArg()).AndReturn(None)
     chrome_channel_util._GetChannelData().AndReturn(
         self.OMAHAPROXY_HEADER + self.OMAHAPROXY_CSV_DATA)
     chrome_channel_util.memcache.set(mox.IgnoreArg(),
                                      mox.IgnoreArg(),
                                      time=mox.IgnoreArg()).AndReturn(None)
     self.mox_obj.ReplayAll()
     channel_info = chrome_channel_util.GetAllChannelVersions('windows')
     self.assertEqual('13.0.761.0', channel_info['canary'])
     self.assertEqual('12.0.742.30', channel_info['dev'])
     self.assertEqual('12.0.742.30', channel_info['beta'])
     self.assertEqual('11.0.696.65', channel_info['stable'])
     self.mox_obj.VerifyAll()