Ejemplo n.º 1
0
    def test_cache_table_empty_table(self):
        inst = MemoryDescriptorIndex(DataMemoryElement(), -1)
        inst._table = {}
        expected_table_pickle_bytes = pickle.dumps(inst._table, -1)

        inst.cache_table()
        ntools.assert_is_not_none(inst.cache_element)
        ntools.assert_equal(inst.cache_element.get_bytes(),
                            expected_table_pickle_bytes)
Ejemplo n.º 2
0
    def test_cache_table_empty_table(self):
        inst = MemoryDescriptorIndex(DataMemoryElement(), -1)
        inst._table = {}
        expected_table_pickle_bytes = pickle.dumps(inst._table, -1)

        inst.cache_table()
        self.assertIsNotNone(inst.cache_element)
        self.assertEqual(inst.cache_element.get_bytes(),
                         expected_table_pickle_bytes)
Ejemplo n.º 3
0
    def test_cache_table_empty_table(self):
        inst = MemoryDescriptorIndex(DataMemoryElement(), -1)
        inst._table = {}
        expected_table_pickle_bytes = pickle.dumps(inst._table, -1)

        inst.cache_table()
        self.assertIsNotNone(inst.cache_element)
        self.assertEqual(inst.cache_element.get_bytes(),
                         expected_table_pickle_bytes)
Ejemplo n.º 4
0
 def test_cache_table_no_cache(self):
     inst = MemoryDescriptorIndex()
     inst._table = {}
     inst.cache_table()  # should basically do nothing
     ntools.assert_is_none(inst.cache_element)
Ejemplo n.º 5
0
 def test_cache_table_no_cache(self):
     inst = MemoryDescriptorIndex()
     inst._table = {}
     inst.cache_table()  # should basically do nothing
     self.assertIsNone(inst.cache_element)