Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'left' parameter on seed #1701

Merged
merged 4 commits into from Aug 18, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Rename util function for tests

  • Loading branch information
alxhotel committed Aug 12, 2019
commit 35fc44f9b98d6970244a517a5a9ca6175a3b40f5
@@ -2,12 +2,12 @@ const os = require('os')
const fs = require('fs')
const path = require('path')

exports.getTestPath = function (infix, infoHash) {
let testPath
exports.getDownloadPath = function (infix, infoHash) {
let downloadPath
try {
testPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test')
downloadPath = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent', 'test')
} catch (err) {
testPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test')
downloadPath = path.join(typeof os.tmpdir === 'function' ? os.tmpdir() : '/', 'webtorrent', 'test')
}
return path.join(testPath, infix, infoHash)
return path.join(downloadPath, infix, infoHash)
}
@@ -27,7 +27,7 @@ test('blocklist blocks peers discovered via DHT', function (t) {
client1.on('warning', function (err) { t.fail(err) })

var torrent1 = client1.add(fixtures.leaves.parsedTorrent, {
path: common.getTestPath('client_1', fixtures.leaves.parsedTorrent.infoHash)
path: common.getDownloadPath('client_1', fixtures.leaves.parsedTorrent.infoHash)
})

torrent1.on('peer', function () {
@@ -67,7 +67,7 @@ test('blocklist blocks peers discovered via DHT', function (t) {
client2.on('warning', function (err) { t.fail(err) })

var torrent2 = client2.add(fixtures.leaves.parsedTorrent, {
path: common.getTestPath('client_2', fixtures.leaves.parsedTorrent.infoHash)
path: common.getDownloadPath('client_2', fixtures.leaves.parsedTorrent.infoHash)
})

torrent2.on('blockedPeer', function (addr) {
@@ -40,7 +40,7 @@ test('blocklist blocks peers discovered via tracker', function (t) {
client1.on('warning', function (err) { t.fail(err) })

var torrent1 = client1.add(parsedTorrent, {
path: common.getTestPath('client_1', parsedTorrent.infoHash)
path: common.getDownloadPath('client_1', parsedTorrent.infoHash)
})

torrent1.on('invalidPeer', function () {
@@ -62,7 +62,7 @@ test('blocklist blocks peers discovered via tracker', function (t) {
client2.on('warning', function (err) { t.fail(err) })

var torrent2 = client2.add(parsedTorrent, {
path: common.getTestPath('client_2', parsedTorrent.infoHash)
path: common.getDownloadPath('client_2', parsedTorrent.infoHash)
})

torrent2.once('blockedPeer', function () {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.