def testManifestWithOneLicense(self):
    self._http._instance_response = ('{"hostname":"test",'
                                     '"licenses":[{"id":"TEST-LICENSE"}]}')
    self._bundle.AddSource(self.tmp_path)
    self._bundle.Verify()
    _ = self._bundle.Bundleup()
    manifest_json = self._bundle._manifest._ToJson()
    manifest_obj = json.loads(manifest_json)
    self.assertTrue(self._bundle._manifest._IsManifestNeeded())
    self.assertEqual(1, len(manifest_obj['licenses']))
    self.assertEqual('TEST-LICENSE', manifest_obj['licenses'][0])
    self._VerifyTarHas(self._tar_path, ['manifest.json', 'disk.raw'])
    self._VerifyFileContentsInTarball(self._tar_path,
                                      'manifest.json',
                                      '{"licenses": ["TEST-LICENSE"]}')
Tests manifest is populated with 1 license.
dataset/ETHPy150Open GoogleCloudPlatform/compute-image-packages/legacy/gcimagebundle/gcimagebundlelib/tests/block_disk_test.py/FsRawDiskTest.testManifestWithOneLicense