Ejemplo n.º 1
0
 def setUp(self):
     self.repository_path = os.path.join(example_repositories, "bazaar")
     os.symlink("%s/bzr" % self.repository_path, "%s/.bzr" % self.repository_path)
     self.repos = BazaarRepository(self.repository_path)
     self.tmpdir = tempfile.mkdtemp()
     self.repos.checkout(self.tmpdir)
     self.wc = BazaarWorkingCopy(self.tmpdir)
     self.latest_version = "4"
     self.previous_version = "1"
Ejemplo n.º 2
0
class TestBazaarWorkingCopy(unittest.TestCase, BaseTestWorkingCopy):
    def setUp(self):
        self.repository_path = os.path.join(example_repositories, "bazaar")
        os.symlink("%s/bzr" % self.repository_path,
                   "%s/.bzr" % self.repository_path)
        self.repos = BazaarRepository(self.repository_path)
        self.tmpdir = tempfile.mkdtemp()
        self.repos.checkout(self.tmpdir)
        self.wc = BazaarWorkingCopy(self.tmpdir)
        self.latest_version = "4"
        self.previous_version = "1"

    def tearDown(self):
        os.unlink("%s/.bzr" % self.repository_path)
        shutil.rmtree(self.tmpdir)

    def test__status(self):
        self.assertEqual(
            self.wc.status(), {
                'modified':
                set([]),
                'removed':
                set([]),
                'missing':
                set([]),
                'unknown':
                set([]),
                'added':
                set([]),
                'clean':
                set([
                    'subpackage', 'default.param', 'main.py', 'romans.param',
                    'subpackage/__init__.py', 'subpackage/somemodule.py'
                ])
            })
        self.change_file()
        self.assertEqual(
            self.wc.status(), {
                'modified':
                set(['romans.param']),
                'removed':
                set([]),
                'missing':
                set([]),
                'unknown':
                set([]),
                'added':
                set([]),
                'clean':
                set([
                    'subpackage', 'default.param', 'main.py',
                    'subpackage/__init__.py', 'subpackage/somemodule.py'
                ])
            })
Ejemplo n.º 3
0
class TestBazaarWorkingCopy(unittest.TestCase, BaseTestWorkingCopy):

    def setUp(self):
        self.repository_path = os.path.join(example_repositories, "bazaar")
        os.symlink("%s/bzr" % self.repository_path, "%s/.bzr" % self.repository_path)
        self.repos = BazaarRepository(self.repository_path)
        self.tmpdir = tempfile.mkdtemp()
        self.repos.checkout(self.tmpdir)
        self.wc = BazaarWorkingCopy(self.tmpdir)
        self.latest_version = "4"
        self.previous_version = "1"

    def tearDown(self):
        os.unlink("%s/.bzr" % self.repository_path)
        shutil.rmtree(self.tmpdir)

    def test__status(self):
        self.assertEqual(self.wc.status(),
                         {'modified': set([]), 'removed': set([]),
                          'missing': set([]), 'unknown': set([]),
                          'added': set([]),
                          'clean': set(['subpackage',
                                        'default.param',
                                        'main.py', 'romans.param',
                                        'subpackage/__init__.py',
                                        'subpackage/somemodule.py'])})
        self.change_file()
        self.assertEqual(self.wc.status(),
                         {'modified': set(['romans.param']), 'removed': set([]),
                          'missing': set([]), 'unknown': set([]),
                          'added': set([]),
                          'clean': set(['subpackage',
                                        'default.param',
                                        'main.py',
                                        'subpackage/__init__.py',
                                        'subpackage/somemodule.py'])})