Exemplo n.º 1
0
    def test_git_no_local(self):
        with SettingsOverride(DEBUG=False):
            client = SourceClient('/some/local/url', 'git')
            self.assertRaises(ClientError, _fetch_git, client)

            client = SourceClient('/etc', 'git')
            self.assertRaises(ClientError, _fetch_git, client)
Exemplo n.º 2
0
 def test_github_client_https(self):
     client = SourceClient('https://[email protected]/mrj0/jep.git')
     _fetch_github(client, session=FakeRequestsSession(GITHUB_JEP_REPO))
     self.assertEqual('mrj0', client.discovered['author'])
     self.assertEqual('http://jepp.sourceforge.net/',
                      client.discovered['url'])
     self.assertEqual('Embed Python in Java',
                      client.discovered['description'])
Exemplo n.º 3
0
    def test_git_fetch_tcp(self, mock):
        def make_test_files(path, local):
            touch_test_files(local.path, ['test_file', '.git/somefile'])

        mock.side_effect = make_test_files

        client = SourceClient('git://github.com/mrj0/jep.git', 'git')
        _fetch_git(client)
        self.assertTrue('test_file' in client.files)
        self.assertFalse('.git/somefile' in client.files)
Exemplo n.º 4
0
 def test_bitbucket(self):
     client = SourceClient('ssh://[email protected]/andrewgodwin/south',
                           'hg')
     _fetch_bitbucket(client,
                      session=FakeRequestsSession(BITBUCKET_SOUTH_REPO))
     self.assertEqual('andrewgodwin', client.discovered['author'])
     self.assertEqual('http://south.aeracode.org/',
                      client.discovered['url'])
     self.assertEqual('Migrations for Django',
                      client.discovered['description'])
Exemplo n.º 5
0
    def test_mercurial_fetch(self, mock):
        def make_test_files(*args, **kwargs):
            touch_test_files(kwargs['dest'], ['test_file', '.hg/somefile'])

        mock.side_effect = make_test_files

        client = SourceClient('ssh://[email protected]/andrewgodwin/south',
                              'hg')
        _fetch_mercurial(client)
        self.assertTrue('test_file' in client.files)
        self.assertFalse('.hg/somefile' in client.files)