def test_start_connection(self, mock_ftp): self.storage._start_connection() self.assertIsNotNone(self.storage._connection) # Start active storage = ftp.FTPStorage(location='a'+URL) storage._start_connection()
def test_init_location_from_setting(self, mock_setting): storage = ftp.FTPStorage() self.assertTrue(mock_setting.called) self.assertEqual(storage.location, URL)
def setUp(self): self.storage = ftp.FTPStorage(location=URL)
def test_init_no_location(self): with self.assertRaises(ImproperlyConfigured): ftp.FTPStorage()
def test_url(self): with self.assertRaises(ValueError): self.storage._base_url = None self.storage.url('foo') self.storage = ftp.FTPStorage(location=URL, base_url='http://foo.bar/') self.assertEqual('http://foo.bar/foo', self.storage.url('foo'))