Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.repo_tests.RepositoryGenspecTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def backup
def test_latest_raises_error_if_there_are_no_generations
def test_latest_returns_only_generation
def test_latest_returns_newest_generation
def test_other_spec_returns_itself
def test_noninteger_spec_raises_error
def test_nonexistent_spec_raises_error

Public Attributes

 tempdir
 repo

Detailed Description

Definition at line 706 of file repo_tests.py.


Member Function Documentation

Definition at line 730 of file repo_tests.py.

00730 
00731     def backup(self):
00732         gen = self.repo.start_generation()
00733         self.repo.commit_client()
00734         self.repo.commit_shared()
00735         self.repo.lock_client('client_name')
00736         self.repo.lock_shared()
00737         return gen

Here is the caller graph for this function:

Definition at line 708 of file repo_tests.py.

00708 
00709     def setUp(self):
00710         self.tempdir = tempfile.mkdtemp()
00711 
00712         repodir = os.path.join(self.tempdir, 'repo')
00713         os.mkdir(repodir)
00714         fs = obnamlib.LocalFS(repodir)
00715         self.repo = obnamlib.Repository(fs, obnamlib.DEFAULT_NODE_SIZE,
00716                                         obnamlib.DEFAULT_UPLOAD_QUEUE_SIZE,
00717                                         obnamlib.DEFAULT_LRU_SIZE, None,
00718                                         obnamlib.IDPATH_DEPTH,
00719                                         obnamlib.IDPATH_BITS,
00720                                         obnamlib.IDPATH_SKIP,
00721                                         time.time, 0, '')
00722         self.repo.lock_root()
00723         self.repo.add_client('client_name')
00724         self.repo.commit_root()
00725         self.repo.lock_client('client_name')
00726         self.repo.lock_shared()

Definition at line 727 of file repo_tests.py.

00727 
00728     def tearDown(self):
00729         shutil.rmtree(self.tempdir)

Definition at line 738 of file repo_tests.py.

00738 
00739     def test_latest_raises_error_if_there_are_no_generations(self):
00740         self.assertRaises(obnamlib.Error, self.repo.genspec, 'latest')

Definition at line 745 of file repo_tests.py.

00745 
00746     def test_latest_returns_newest_generation(self):
00747         self.backup()
00748         gen = self.backup()
00749         self.assertEqual(self.repo.genspec('latest'), gen)

Here is the call graph for this function:

Definition at line 741 of file repo_tests.py.

00741 
00742     def test_latest_returns_only_generation(self):
00743         gen = self.backup()
00744         self.assertEqual(self.repo.genspec('latest'), gen)

Here is the call graph for this function:

Definition at line 759 of file repo_tests.py.

00759 
00760     def test_nonexistent_spec_raises_error(self):
00761         self.backup()
00762         self.assertRaises(obnamlib.Error, self.repo.genspec, 1234)
00763 

Here is the call graph for this function:

Definition at line 754 of file repo_tests.py.

00754 
00755     def test_noninteger_spec_raises_error(self):
00756         gen = self.backup()
00757         self.assertNotEqual(gen, 'foo')
00758         self.assertRaises(obnamlib.Error, self.repo.genspec, 'foo')

Here is the call graph for this function:

Definition at line 750 of file repo_tests.py.

00750 
00751     def test_other_spec_returns_itself(self):
00752         gen = self.backup()
00753         self.assertEqual(self.repo.genspec(str(gen)), gen)

Here is the call graph for this function:


Member Data Documentation

Definition at line 714 of file repo_tests.py.

Definition at line 709 of file repo_tests.py.


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