Exemple #1
0
    def test_add_data_length_2(self):
        exporter = ItemExporter(format=trivial_format)
        data_wrapper = DataWrapper()

        exporter.add_data(data_wrapper, self.model, [((), ()), ((0, ), (0, ))])

        self.assertFalse(data_wrapper.has_format(trivial_format))
Exemple #2
0
    def test_add_data_fail(self):
        exporter = TrivialExporter(format=trivial_format)
        data_wrapper = DataWrapper()

        exporter.add_data(data_wrapper, self.model, [])

        self.assertFalse(data_wrapper.has_format(trivial_format))
Exemple #3
0
    def test_add_data_(self):
        exporter = ItemExporter(format=trivial_format)
        data_wrapper = DataWrapper()

        exporter.add_data(data_wrapper, self.model, [((0, ), (0, ))])

        self.assertTrue(data_wrapper.has_format(trivial_format))
        self.assertEqual(data_wrapper.get_mimedata('null/null'), b'1')