def test_list_manifest_warnings(self): """Tests that text warnings listed in the manifest are returned.""" manifest = { 'name': 'test', 'status': 'partial', 'warnings': [{ 'member': 'member', 'text': ['warning A', 'warning B'], 'status': 'partial' }] } warnings = report.manifest_warnings(manifest, {'test': manifest}) self.assertEqual(warnings, [ { 'member': 'member', 'text': '<span class="ca-feature partial">chrome.test.member</span>: ' 'warning A' }, { 'member': 'member', 'text': '<span class="ca-feature partial">chrome.test.member</span>: ' 'warning B' }, ])
def test_not_implemented_manifest_warnings(self): """Tests that not implemented warnings in the manifest are returned.""" manifest = { 'name': 'test', 'status': 'partial', 'warnings': ['member'] } warnings = report.manifest_warnings(manifest, {'test': manifest}) self.assertEqual(warnings, [{'member': 'member', 'text': '<span class="ca-feature none">chrome.test.member</span>: ' 'Not implemented in the polyfill.'}])
def test_text_manifest_warnings(self): """Tests that text warnings in the manifest are returned.""" manifest = { 'name': 'test', 'status': 'partial', 'warnings': [ {'member': 'member', 'text': 'a warning', 'status': 'partial'}] } warnings = report.manifest_warnings(manifest, {'test': manifest}) self.assertEqual(warnings, [{'member': 'member', 'text': '<span class="ca-feature partial">chrome.test.member</span>: ' 'a warning'}])
def test_not_implemented_manifest_warnings(self): """Tests that not implemented warnings in the manifest are returned.""" manifest = { 'name': 'test', 'status': 'partial', 'warnings': ['member'] } warnings = report.manifest_warnings(manifest, {'test': manifest}) self.assertEqual(warnings, [{ 'member': 'member', 'text': '<span class="ca-feature none">chrome.test.member</span>: ' 'Not implemented in the polyfill.' }])