Exemplo n.º 1
0
    def test_serialize_logindex_write(self):
        log_index = LogIndexEntry(LogIndexEntry.WRITE, 34234242, needs_commit=True)
        
        serialized = LogIndexEntrySerializer.serialize(log_index)

        self.assertEquals(serialized, 
                          decodehexstr("03020a5f8201"))
Exemplo n.º 2
0
    def test_serialize_logindex_end_tx(self):
        log_index = LogIndexEntry(LogIndexEntry.END_TX, needs_commit=False)
        
        serialized = LogIndexEntrySerializer.serialize(log_index)

        self.assertEquals(serialized, 
                          decodehexstr("020000000000"))
Exemplo n.º 3
0
    def test_serialize_logindex_begin_tx(self):
        log_index = LogIndexEntry(LogIndexEntry.BEGIN_TX, needs_commit=True)
        
        serialized = LogIndexEntrySerializer.serialize(log_index)

        self.assertEquals(serialized, 
                          decodehexstr("010000000001"))
Exemplo n.º 4
0
    def test_serialize_logindex_write(self):
        log_index = LogIndexEntry(LogIndexEntry.WRITE,
                                  34234242,
                                  needs_commit=True)

        serialized = LogIndexEntrySerializer.serialize(log_index)

        self.assertEquals(serialized, decodehexstr("03020a5f8201"))
Exemplo n.º 5
0
    def test_serialize_logindex_end_tx(self):
        log_index = LogIndexEntry(LogIndexEntry.END_TX, needs_commit=False)

        serialized = LogIndexEntrySerializer.serialize(log_index)

        self.assertEquals(serialized, decodehexstr("020000000000"))
Exemplo n.º 6
0
    def test_serialize_logindex_begin_tx(self):
        log_index = LogIndexEntry(LogIndexEntry.BEGIN_TX, needs_commit=True)

        serialized = LogIndexEntrySerializer.serialize(log_index)

        self.assertEquals(serialized, decodehexstr("010000000001"))