Exemplo n.º 1
0
def test_curl():
    s = _ext_get_session()

    d = downloaders.CurlDownloader(s)
    command = d._create_command('download_url', 'save_to')
    assert command[0] == 'curl'
    assert 'download_url' in command
    assert 'save_to' in command

    d._prepare_cookies(command, 'http://www.coursera.org')
    assert any("csrf_token=csrfclass001" in e for e in command)
    assert any("session=sessionclass1" in e for e in command)
Exemplo n.º 2
0
    def test_curl(self):
        s = self._get_session()

        d = downloaders.CurlDownloader(s)
        command = d._create_command('download_url', 'save_to')
        self.assertEquals(command[0], 'curl')
        self.assertTrue('download_url' in command)
        self.assertTrue('save_to' in command)

        d._prepare_cookies(command, 'http://www.coursera.org')
        self.assertTrue(any("csrf_token=csrfclass001" in e for e in command))
        self.assertTrue(any("session=sessionclass1" in e for e in command))