Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.chunklist_tests.ChunkListTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_raises_keyerror_for_missing_chunk
def test_adds_chunk
def test_adds_second_chunk
def test_removes_chunk

Public Attributes

 tempdir
 hooks
 list

Detailed Description

Definition at line 24 of file chunklist_tests.py.


Member Function Documentation

Definition at line 26 of file chunklist_tests.py.

00026 
00027     def setUp(self):
00028         self.tempdir = tempfile.mkdtemp()
00029         fs = obnamlib.LocalFS(self.tempdir)
00030         self.hooks = obnamlib.HookManager()
00031         self.hooks.new('repository-toplevel-init')
00032         self.list = obnamlib.ChunkList(fs, 
00033                                        obnamlib.DEFAULT_NODE_SIZE,
00034                                        obnamlib.DEFAULT_UPLOAD_QUEUE_SIZE,
00035                                        obnamlib.DEFAULT_LRU_SIZE, self)

Definition at line 36 of file chunklist_tests.py.

00036 
00037     def tearDown(self):
00038         shutil.rmtree(self.tempdir)

Definition at line 42 of file chunklist_tests.py.

00042 
00043     def test_adds_chunk(self):
00044         self.list.add(0, 'checksum')
00045         self.assertEqual(self.list.get_checksum(0), 'checksum')
        

Definition at line 46 of file chunklist_tests.py.

00046 
00047     def test_adds_second_chunk(self):
00048         self.list.add(0, 'checksum')
00049         self.list.add(1, 'checksum1')
00050         self.assertEqual(self.list.get_checksum(1), 'checksum1')

Definition at line 39 of file chunklist_tests.py.

00039 
00040     def test_raises_keyerror_for_missing_chunk(self):
00041         self.assertRaises(KeyError, self.list.get_checksum, 0)
        

Definition at line 51 of file chunklist_tests.py.

00051 
00052     def test_removes_chunk(self):
00053         self.list.add(0, 'checksum')
00054         self.list.remove(0)
00055         self.assertRaises(KeyError, self.list.get_checksum, 0)
00056 

Member Data Documentation

Definition at line 29 of file chunklist_tests.py.

Definition at line 31 of file chunklist_tests.py.

Definition at line 27 of file chunklist_tests.py.


The documentation for this class was generated from the following file: