Beispiel #1
0
    def test_post_freeze(self):
        c = Castor(self.test_root)
        c.apply()

        c.freeze()

        self.assertTrue(path.exists(path.join(self.test_root, 'dam', 'modules', 'test', 'foo')))
Beispiel #2
0
    def test_freeze(self):
        c = Castor(self.test_root)
        c.apply()

        repo_dir = path.join(self.test_root, 'lodge')
        g = git.Git(repo_dir)
        g.checkout('master')

        modified_file = path.join(self.test_root, 'lodge', 'test.txt')
        with open(modified_file, 'w') as f:
            f.write('Saluton')

        r = git.Repo(repo_dir)
        r.index.add([modified_file])
        r.index.commit('Translated to Esperanto')
        r.create_tag('tag2')

        c.freeze()

        with open(path.join(self.test_root, 'Castorfile'), 'r') as f:
            cf = json.load(f)
            self.assertEqual(cf['lodge'][0]['version'], 'tag2')

        with open(path.join(self.test_root, 'dam', 'test.txt')) as f:
            self.assertEqual('Saluton', f.read())
Beispiel #3
0
    def test_freeze(self):
        c = Castor(self.test_root)
        c.apply()

        repo_dir = path.join(self.test_root, "lodge")
        g = git.Git(repo_dir)
        g.checkout("master")

        modified_file = path.join(self.test_root, "lodge", "test.txt")
        with open(modified_file, "w") as f:
            f.write("Saluton")

        r = git.Repo(repo_dir)
        r.index.add([modified_file])
        r.index.commit("Translated to Esperanto")
        r.create_tag("tag2")

        c.freeze()

        with open(path.join(self.test_root, "Castorfile"), "r") as f:
            cf = json.load(f)
            self.assertEqual(cf["lodge"][0]["version"], "tag2")

        with open(path.join(self.test_root, "dam", "test.txt")) as f:
            self.assertEqual("Saluton", f.read())
Beispiel #4
0
 def test_freeze_files(self):
     c = Castor(self.test_root)
     c.apply()
     c.freeze()
     self.assertTrue(path.exists(path.join(self.test_root, 'dam', '.htaccess')))
     self.assertTrue(path.exists(path.join(
         self.test_root,
         'dam',
         'app/documentation/readme.md'
     )))
Beispiel #5
0
 def test_freeze_files(self):
     c = Castor(self.test_root)
     c.apply()
     c.freeze()
     self.assertTrue(path.exists(path.join(self.test_root, "dam", ".htaccess")))