Ejemplo n.º 1
0
    def _setResource(self, new_resource):
        """Set the current resource to a new value."""
        self._currentResource = new_resource
        self._dirty = True


class MemoryRepositoryFactoryResource(TestResource):
    def make(self, dependency_resources):
        return memory.RepositoryFactory()


# what repository implementations do we need to test?
repo_implementations = [
    ('file', {
        'repo_impl': file.RepositoryFactory(),
        'resources': [('sample_url', DirtyTempDirResource())]
    }),
    ('memory', {
        'resources': [('repo_impl', MemoryRepositoryFactoryResource())],
        'sample_url': 'memory:'
    }),
]


class Case(ResourcedTestCase):
    """Reference tests."""
    def passing(self):
        pass

    def unexpected_success(self):
Ejemplo n.º 2
0
 def __init__(self, ui):
     """Create a Command object with ui ui."""
     self.ui = ui
     self.repository_factory = file.RepositoryFactory()
     self._init()
Ejemplo n.º 3
0
 def test_initialise_expands_user_directory(self):
     short_path = self.useFixture(HomeDirTempDir()).short_path
     repo = file.RepositoryFactory().initialise(short_path)
     self.assertTrue(os.path.exists(repo.base))
Ejemplo n.º 4
0
 def test_open_expands_user_directory(self):
     short_path = self.useFixture(HomeDirTempDir()).short_path
     repo1 = file.RepositoryFactory().initialise(short_path)
     repo2 = file.RepositoryFactory().open(short_path)
     self.assertEqual(repo1.base, repo2.base)
Ejemplo n.º 5
0
 def setUp(self):
     super(FileRepositoryFixture, self).setUp()
     self.repo = file.RepositoryFactory().initialise(self.tempdir)
     self.resource.dirtied(self.tempdir)