Add tests to GitHubRemoteBook (#11953)

* Tests for githubRemoteBook class

* Add some tests and remove unused class

* Address PR comments
This commit is contained in:
Barbara Valdez
2020-09-04 18:51:04 -07:00
committed by GitHub
parent 704222b8d7
commit fa5bfee0cf
5 changed files with 133 additions and 36 deletions

View File

@@ -8,7 +8,6 @@ import * as loc from '../common/localizedConstants';
import * as vscode from 'vscode';
import { RemoteBookDialogModel } from '../dialog/remoteBookDialogModel';
import { GitHubRemoteBook } from '../book/githubRemoteBook';
import { SharedRemoteBook } from '../book/sharedRemoteBook';
import { winPlatform, macPlatform } from '../common/constants';
const assetNameRE = /([a-zA-Z0-9]+)(?:-|_)([a-zA-Z0-9.]+)(?:-|_)([a-zA-Z0-9]+).(zip|tar.gz|tgz)/;
@@ -20,8 +19,6 @@ export class RemoteBookController {
public async setRemoteBook(url: vscode.Uri, remoteLocation: string, asset?: IAsset): Promise<void> {
if (remoteLocation === 'GitHub') {
this.model.remoteBook = new GitHubRemoteBook(url, this.outputChannel, asset);
} else {
this.model.remoteBook = new SharedRemoteBook(url, this.outputChannel);
}
return await this.model.remoteBook.createLocalCopy();
}