Esempio n. 1
0
 def test_channels(self):
     # Test that parsing a simple top level channels.json file produces the
     # expected set of channels.  The Nexus 7 daily images have a device
     # specific keyring.
     channels = get_channels('channel.channels_01.json')
     self.assertEqual(channels.daily.devices.nexus7.index,
                      '/daily/nexus7/index.json')
     self.assertEqual(channels.daily.devices.nexus7.keyring.path,
                      '/daily/nexus7/device-keyring.tar.xz')
     self.assertEqual(channels.daily.devices.nexus7.keyring.signature,
                      '/daily/nexus7/device-keyring.tar.xz.asc')
     self.assertEqual(channels.daily.devices.nexus4.index,
                      '/daily/nexus4/index.json')
     self.assertIsNone(
         getattr(channels.daily.devices.nexus4, 'keyring', None))
     self.assertEqual(channels.stable.devices.nexus7.index,
                      '/stable/nexus7/index.json')
Esempio n. 2
0
 def test_channels(self):
     # We can parse new-style channels.json files.
     channels = get_channels('channel.channels_04.json')
     self.assertEqual(channels.daily.alias, 'saucy')
     self.assertEqual(channels.daily.devices.grouper.index,
                      '/daily/grouper/index.json')
     self.assertEqual(channels.daily.devices.mako.index,
                      '/daily/mako/index.json')
     # 'saucy' channel has no alias.
     self.assertRaises(AttributeError, getattr, channels.saucy, 'alias')
     self.assertEqual(channels.saucy.devices.mako.index,
                      '/saucy/mako/index.json')
     # 'saucy-proposed' has a hidden field.
     self.assertTrue(channels.saucy_proposed.hidden)
     self.assertEqual(channels.saucy_proposed.devices.maguro.index,
                      '/saucy-proposed/maguro/index.json')
     # Device specific keyrings are still supported.
     self.assertEqual(channels.saucy.devices.manta.keyring.path,
                      '/saucy/manta/device-signing.tar.xz')
Esempio n. 3
0
 def test_channel_version_proposed(self):
     # The channel name has both a dot and a dash in it.
     channels = get_channels('channel.channels_03.json')
     self.assertEqual(channels['14.04-proposed'].devices.grouper.index,
                      '/14.04-proposed/grouper/index.json')
Esempio n. 4
0
 def test_channel_version(self):
     # The channel name has a dot in it.
     channels = get_channels('channel.channels_03.json')
     self.assertEqual(channels['13.10'].devices.grouper.index,
                      '/13.10/grouper/index.json')
Esempio n. 5
0
 def test_bad_getitem(self):
     # Trying to get a channel via getitem which doesn't exist.
     channels = get_channels('channel.channels_02.json')
     self.assertRaises(KeyError, getitem, channels, 'daily-testing')
Esempio n. 6
0
 def test_daily_proposed(self):
     # The channel name has a dash in it.
     channels = get_channels('channel.channels_02.json')
     self.assertEqual(channels['daily-proposed'].devices.grouper.index,
                      '/daily-proposed/grouper/index.json')
Esempio n. 7
0
 def test_getattr_failure(self):
     # Test the getattr syntax on an unknown channel or device combination.
     channels = get_channels('channel.channels_01.json')
     self.assertRaises(AttributeError, getattr, channels, 'bleeding')
     self.assertRaises(AttributeError, getattr, channels.stable, 'nexus3')
Esempio n. 8
0
 def test_hidden_defaults_to_false(self):
     # If a channel does not have a hidden field, it defaults to false.
     channels = get_channels('channel.channels_04.json')
     self.assertFalse(channels.daily.hidden)