Esempio n. 1
0
    def test_fetch_invalid_raise(self):
        with self.assertRaises(TypeError):
            pscp.fetch(refspec=b'refs/pscp/123')

        with self.assertRaises(TypeError):
            pscp.fetch(refmap=b'refs/pscp/123')

        with self.assertRaises(TypeError):
            pscp.fetch(repository=b'origin')
Esempio n. 2
0
    def test_fetch_repo(self, run_git):
        pscp.fetch(repository='another repo')

        run_git.assert_called_once_with(
            'fetch', 'another repo', 'refs/pscp/*:refs/pscp/*')
Esempio n. 3
0
    def test_fetch_refspec(self, run_git):
        pscp.fetch('some refspec')

        run_git.assert_called_once_with(
            'fetch', 'origin', 'some refspec',
            '--refmap', 'refs/pscp/*:refs/pscp/*')
Esempio n. 4
0
    def test_fetch_refmap_refspec(self, run_git):
        pscp.fetch('another refspec', refmap='another refmap')

        run_git.assert_called_once_with(
            'fetch', 'origin', 'another refspec',
            '--refmap', 'another refmap')
Esempio n. 5
0
    def test_fetch(self, run_git):
        pscp.fetch()

        run_git.assert_called_once_with(
            'fetch', 'origin', 'refs/pscp/*:refs/pscp/*')