예제 #1
0
    def test_app_components_get_set(self):
        cb = CrashDatabase(None, {'dbfile': ':memory:', 'crashes_base_url': self.crash_base_url})
        crash_id = cb.upload(self.r)

        self.assertEqual(cb.get_app_components(crash_id), [])

        cb.set_app_components(crash_id, ['sand'])
        self.assertEqual(cb.get_app_components(crash_id), ['sand'])

        cb.set_app_components(crash_id, ['sand'])
        self.assertEqual(cb.get_app_components(crash_id), ['sand'])
예제 #2
0
    def test_app_components_remove(self):
        cb = CrashDatabase(None, {'dbfile': ':memory:', 'crashes_base_url': self.crash_base_url})
        crash_id = cb.upload(self.r)

        self.assertRaises(ValueError, cb.remove_app_component, *(crash_id, 'sand'))
        self.assertIsNone(cb.remove_app_component(crash_id))

        cb.set_app_components(crash_id, ['sand'])
        self.assertIsNone(cb.remove_app_component(crash_id, 'sand'))
        self.assertEqual(cb.get_app_components(crash_id), [])

        cb.set_app_components(crash_id, ['sand'])
        self.assertIsNone(cb.remove_app_component(crash_id))
        self.assertEqual(cb.get_app_components(crash_id), [])