Esempio n. 1
0
    def test_get_processed(self):
        faked_hb_row_object = DotDict()
        faked_hb_row_object.columns = DotDict()
        faked_hb_row_object.columns['processed_data:json'] = DotDict()
        faked_hb_row_object.columns['processed_data:json'].value = \
            self._fake_unredacted_processed_crash_as_string()

        processed_crash = DotDict()
        with self.storage.hbase() as conn:
            conn.client.getRowWithColumns.return_value = [faked_hb_row_object]

            processed_crash = self.storage.get_processed(
                "936ce666-ff3b-4c7a-9674-367fe2120408"
            )
            eq_(
                processed_crash,
                self._fake_redacted_processed_crash()
            )
Esempio n. 2
0
    def test_get_processed(self):
        faked_hb_row_object = DotDict()
        faked_hb_row_object.columns = DotDict()
        faked_hb_row_object.columns['processed_data:json'] = DotDict()
        faked_hb_row_object.columns['processed_data:json'].value = \
            self._fake_unredacted_processed_crash_as_string()

        processed_crash = DotDict()
        with self.storage.hbase() as conn:
            conn.table.return_value.row.return_value = {
                'processed_data:json':
                self._fake_unredacted_processed_crash_as_string()
            }

            processed_crash = self.storage.get_processed(
                "936ce666-ff3b-4c7a-9674-367fe2120408"
            )
            self.assertEqual(
                processed_crash,
                self._fake_redacted_processed_crash()
            )