First pass of projects test coverage

This commit is contained in:
Nick O'Leary
2018-01-16 23:04:39 +00:00
parent b76010cb5a
commit f95b414d22
11 changed files with 497 additions and 2 deletions

View File

@@ -968,6 +968,7 @@ function init(_settings, _runtime) {
runtime = _runtime;
log = runtime.log;
projectsDir = fspath.join(settings.userDir,"projects");
authCache.init();
}
module.exports = {

View File

@@ -17,6 +17,9 @@
var authCache = {}
module.exports = {
init: function() {
authCache = {};
},
clear: function(project,remote, user) {
if (user && remote && authCache[project] && authCache[project][remote]) {
delete authCache[project][remote][user];

View File

@@ -36,7 +36,7 @@ function getListenPath() {
var ResponseServer = function(auth) {
return new Promise(function(resolve, reject) {
server = net.createServer(function(connection) {
var server = net.createServer(function(connection) {
connection.setEncoding('utf8');
var parts = [];
connection.on('data', function(data) {
@@ -81,7 +81,7 @@ var ResponseServer = function(auth) {
var ResponseSSHServer = function(auth) {
return new Promise(function(resolve, reject) {
server = net.createServer(function(connection) {
var server = net.createServer(function(connection) {
connection.setEncoding('utf8');
var parts = [];
connection.on('data', function(data) {
@@ -93,6 +93,7 @@ var ResponseSSHServer = function(auth) {
console.log("LINE:",line);
parts = [];
if (line==='The') {
// TODO: document these exchanges!
connection.end('yes');
// server.close();
} else if (line === 'Enter') {