def testCommit(self): s = GitScm({ 'scm': "git", 'url': self.repodir, 'commit': '0123456789012345678901234567890123456789', 'recipe': "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '', 0), 'unclean')
def testUnpushed(self): f = open(os.path.join(self.repodir_local, "test.txt"), "w") f.write("test modified") f.close() self.callGit('git commit -a -m "modified"', cwd=self.repodir_local) s = GitScm({ 'scm' : "git", 'url' : self.repodir, 'recipe' : "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '', 0), 'unclean')
def testBranch(self): s = GitScm({ 'scm': "git", 'url': self.repodir, 'branch': 'anybranch', 'recipe': "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '', 0), 'unclean')
def testTag(self): s = GitScm({ 'scm': "git", 'url': self.repodir, 'tag': 'v0.1', 'recipe': "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '', 0), 'unclean')
def testUrl(self): s = GitScm({ 'scm' : "git", 'url' : 'anywhere', 'recipe' : "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '', 0), 'unclean')
def testModified(self): f = open(os.path.join(self.repodir_local, "test.txt"), "w") f.write("test modified") f.close() s = GitScm({ 'scm' : "git", 'url' : self.repodir, 'recipe' : "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '')[0], 'dirty')
def testEmpty(self): removePath(self.repodir_local) s = GitScm({ 'scm' : "git", 'url' : self.repodir, 'recipe' : "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '')[0], 'empty')
def testClean(self): s = GitScm({ 'scm' : "git", 'url' : self.repodir, 'recipe' : "foo.yaml#0" }) self.assertEqual(s.status(self.repodir_local, '')[0], 'clean')