mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fixed broken notebook tests (#8885)
This commit is contained in:
@@ -153,12 +153,10 @@ describe('Manage Package Providers', () => {
|
|||||||
should.equal(await provider.canUseProvider(), true);
|
should.equal(await provider.canUseProvider(), true);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Tests disabled. Tracking issue: https://github.com/microsoft/azuredatastudio/issues/8877
|
|
||||||
it('Pip getPackageOverview should return package info successfully', async function (): Promise<void> {
|
it('Pip getPackageOverview should return package info successfully', async function (): Promise<void> {
|
||||||
let testContext = createContext();
|
let testContext = createContext();
|
||||||
testContext.piPyClient.fetchPypiPackage = (packageName) => {
|
testContext.piPyClient.fetchPypiPackage = (packageName) => {
|
||||||
return Promise.resolve(`
|
return Promise.resolve(`{"info":{"summary":"package summary"}, "releases":{"0.0.1":[{"comment_text":""}], "0.0.2":[{"comment_text":""}]}}`);
|
||||||
"{"info":{"summary":"package summary"}, "releases":{"0.0.1":[{"comment_text":""}], "0.0.2":[{"comment_text":""}]}"`);
|
|
||||||
};
|
};
|
||||||
let serverInstallation = createJupyterServerInstallation(testContext);
|
let serverInstallation = createJupyterServerInstallation(testContext);
|
||||||
let client = createPipyClient(testContext);
|
let client = createPipyClient(testContext);
|
||||||
@@ -166,16 +164,15 @@ describe('Manage Package Providers', () => {
|
|||||||
|
|
||||||
await should(provider.getPackageOverview('name')).resolvedWith({
|
await should(provider.getPackageOverview('name')).resolvedWith({
|
||||||
name: 'name',
|
name: 'name',
|
||||||
versions: ['0.0.1', '0.0.2'],
|
versions: ['0.0.2', '0.0.1'],
|
||||||
summary: 'summary'
|
summary: 'package summary'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Conda getPackageOverview should return package info successfully', async function (): Promise<void> {
|
it('Conda getPackageOverview should return package info successfully', async function (): Promise<void> {
|
||||||
let testContext = createContext();
|
let testContext = createContext();
|
||||||
testContext.serverInstallation.executeBufferedCommand = (command) => {
|
testContext.serverInstallation.executeBufferedCommand = (command) => {
|
||||||
return Promise.resolve(`
|
return Promise.resolve(`{"name":[{"version":"0.0.1"}, {"version":"0.0.2"}]}`);
|
||||||
"{"name":[{"version":"0.0.1"}, {"version":"0.0.2}]"`);
|
|
||||||
};
|
};
|
||||||
let serverInstallation = createJupyterServerInstallation(testContext);
|
let serverInstallation = createJupyterServerInstallation(testContext);
|
||||||
|
|
||||||
@@ -183,11 +180,10 @@ describe('Manage Package Providers', () => {
|
|||||||
|
|
||||||
await should(provider.getPackageOverview('name')).resolvedWith({
|
await should(provider.getPackageOverview('name')).resolvedWith({
|
||||||
name: 'name',
|
name: 'name',
|
||||||
versions: ['0.0.1', '0.0.2'],
|
versions: ['0.0.2', '0.0.1'],
|
||||||
summary: undefined
|
summary: undefined
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
function createContext(): TestContext {
|
function createContext(): TestContext {
|
||||||
return {
|
return {
|
||||||
@@ -222,6 +218,7 @@ describe('Manage Package Providers', () => {
|
|||||||
mockInstance.setup(x => x.uninstallPipPackages(TypeMoq.It.isAny())).returns((packages, useMinVersion) => testContext.serverInstallation.uninstallPipPackages(packages));
|
mockInstance.setup(x => x.uninstallPipPackages(TypeMoq.It.isAny())).returns((packages, useMinVersion) => testContext.serverInstallation.uninstallPipPackages(packages));
|
||||||
mockInstance.setup(x => x.getInstalledPipPackages()).returns(() => testContext.serverInstallation.getInstalledPipPackages());
|
mockInstance.setup(x => x.getInstalledPipPackages()).returns(() => testContext.serverInstallation.getInstalledPipPackages());
|
||||||
mockInstance.setup(x => x.getInstalledCondaPackages()).returns(() => testContext.serverInstallation.getInstalledCondaPackages());
|
mockInstance.setup(x => x.getInstalledCondaPackages()).returns(() => testContext.serverInstallation.getInstalledCondaPackages());
|
||||||
|
mockInstance.setup(x => x.executeBufferedCommand(TypeMoq.It.isAny())).returns((command) => testContext.serverInstallation.executeBufferedCommand(command));
|
||||||
mockInstance.setup(x => x.usingConda).returns(() => testContext.serverInstallation.usingConda);
|
mockInstance.setup(x => x.usingConda).returns(() => testContext.serverInstallation.usingConda);
|
||||||
return mockInstance;
|
return mockInstance;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -275,7 +275,6 @@ describe('Manage Packages', () => {
|
|||||||
await should(model.uninstallPackages(TypeMoq.It.isAny())).rejected();
|
await should(model.uninstallPackages(TypeMoq.It.isAny())).rejected();
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Test disabled. Tracking issue: https://github.com/microsoft/azuredatastudio/issues/8877
|
|
||||||
it('current provider should install and uninstall packages successfully', async function (): Promise<void> {
|
it('current provider should install and uninstall packages successfully', async function (): Promise<void> {
|
||||||
let testContext1 = createContext();
|
let testContext1 = createContext();
|
||||||
testContext1.provider.providerId = 'providerId1';
|
testContext1.provider.providerId = 'providerId1';
|
||||||
@@ -318,9 +317,8 @@ describe('Manage Packages', () => {
|
|||||||
await should(model.installPackages(packages)).resolved();
|
await should(model.installPackages(packages)).resolved();
|
||||||
await should(model.uninstallPackages(packages)).resolved();
|
await should(model.uninstallPackages(packages)).resolved();
|
||||||
await should(model.getPackageOverview('p1')).resolved();
|
await should(model.getPackageOverview('p1')).resolved();
|
||||||
await should(model.getLocationTitle()).rejectedWith('location title 2');
|
await should(model.getLocationTitle()).resolvedWith('location title 2');
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
|
|
||||||
function createContext(): TestContext {
|
function createContext(): TestContext {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user