Ejemplo n.º 1
0
    def test_other_branch(self):
        "Run the HgClone command for another branch."
         
        command = HgClone('http://bitbucket.org/cherkf/pony-build-hg-test/')
        command.run(self.context)
        #commands.getoutput('hg', 'update', 'extrabranch')
        
        #pprint.pprint(cmdlist.get_results()) #debugging output

        # check version info
        results_info = command.get_results()
        pprint.pprint(results_info) # debugging output

        assert results_info['version_info'] == '949a4d660f2e 2 default'
        assert results_info['version_type'] == 'hg'

        # check files
        cwd = os.getcwd()
        os.chdir(self.context.tempdir)
        try:
            assert os.path.exists(os.path.join('pony-build-hg-test', 'test1'))
            assert  os.path.exists(os.path.join('pony-build-hg-test',
                                                   'test2'))
          #  assert os.path.exists(os.path.join('pony-build-hg-test', 'test4'))
        finally:
            os.chdir(cwd)
Ejemplo n.º 2
0
    def test_other_branch(self):
        "Run the HgClone command for another branch."
        
        command = HgClone(self.repository_url)
        command.run(self.context)
         # forcibly check out revision 7 instead of revision 1.
        (ret, out, err) = _run_command(['hg', 'checkout', '7'],
                                       cwd='pony-build-hg-test')
        (ret, out, err) = _run_command(['hg', 'identify'],
                                       cwd='pony-build-hg-test')
 
        #os.chdir(cwd) # return to working dir.
        # check version info
        results_info = command.get_results()
        pprint.pprint(results_info) # debugging output

        assert results_info['version_info'] == '949a4d660f2e 2 default'
        assert results_info['version_type'] == 'hg'

        # check files
        cwd = os.getcwd()
        os.chdir(self.context.tempdir)
        try:
             assert ret == 0, (out, err)
             assert os.path.exists(os.path.join('pony-build-hg-test', 'test1'))
             assert os.path.exists(os.path.join('pony-build-hg-test',
                                                   'test2'))
             assert os.path.exists(os.path.join('pony-build-hg-test', 'test4.py'))
        finally:
            os.chdir(cwd)
Ejemplo n.º 3
0
    def test_basic(self):
        "Run the HgClone command and verify that it produces the right repo."
        command = HgClone(self.repository_url)
        command.verbose = True
        command.run(self.context)
 
        pprint.pprint(command.get_results()) # debugging output
 
        os.chdir(self.context.tempdir)
        assert os.path.exists(os.path.join('pony-build-hg-test', 'test1'))
        assert os.path.exists(os.path.join('pony-build-hg-test', 'test2'))
Ejemplo n.º 4
0
    def test_basic(self):
        "Run the HgClone command w/o caching and verify it."
        command = HgClone(self.repository_url, use_cache=False)
        command.verbose = True
        command.run(self.context)
 
        pprint.pprint(command.get_results()) # debugging output
 
        os.chdir(self.context.tempdir)
        assert os.path.exists(os.path.join('pony-build-hg-test', 'test1'))
        assert os.path.exists(os.path.join('pony-build-hg-test', 'test2'))