當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript test_data.ArtifactStoreTestData類代碼示例

本文整理匯總了TypeScript中models/artifact_stores/spec/test_data.ArtifactStoreTestData的典型用法代碼示例。如果您正苦於以下問題:TypeScript ArtifactStoreTestData類的具體用法?TypeScript ArtifactStoreTestData怎麽用?TypeScript ArtifactStoreTestData使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ArtifactStoreTestData類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

  it("should deserialize json to ArtifactStores", () => {
    const artifactStoresJSON = ArtifactStoreTestData.artifactStoreList(
      ArtifactStoreTestData.dockerArtifactStore(),
      ArtifactStoreTestData.mavenArtifactStore()
    );

    const artifactStores = ArtifactStores.fromJSON(artifactStoresJSON);

    expect(artifactStores.length).toEqual(2);

    expect(artifactStores[0].id()).toEqual("hub.docker");
    expect(artifactStores[0].pluginId()).toEqual("cd.go.artifact.docker.registry");
    expect(artifactStores[0].properties().count()).toEqual(3);
    expect(artifactStores[0].properties().valueFor("RegistryURL")).toEqual("https://your_docker_registry_url");
    expect(artifactStores[0].properties().valueFor("Username")).toEqual("admin");
    expect(artifactStores[0].properties().valueFor("Password"))
      .toEqual("AES:tdfTtYtIUSAF2JXJP/3YwA==:43Kjidjuh42NHKisCAs/BQ==");

    expect(artifactStores[1].id()).toEqual("maven.central");
    expect(artifactStores[1].pluginId()).toEqual("cd.go.artifact.maven.registry");
    expect(artifactStores[1].properties().count()).toEqual(3);
    expect(artifactStores[1].properties().valueFor("RegistryURL")).toEqual("https://your.maven.registry");
    expect(artifactStores[1].properties().valueFor("Username")).toEqual("bob");
    expect(artifactStores[1].properties().valueFor("Password"))
      .toEqual("AES:tdfTtYtIUSAF2JXJP/3YwA==:43Kjidjuh42NHKisCAs/BQ==");
  });
開發者ID:GaneshSPatil,項目名稱:gocd,代碼行數:26,代碼來源:artifact_stores_spec.ts

示例2: listArtifactStoreResponse

function listArtifactStoreResponse() {
  return {
    status: 200,
    responseHeaders: {
      "Content-Type": "application/vnd.go.cd.v1+json; charset=utf-8",
      "ETag": "some-etag"
    },
    responseText: JSON.stringify(ArtifactStoreTestData.artifactStoreList(ArtifactStoreTestData.dockerArtifactStore()))
  };
}
開發者ID:Skarlso,項目名稱:gocd,代碼行數:10,代碼來源:artifact_stores_crud_spec.ts

示例3: it

  it("should create a new artifact store", () => {
    jasmine.Ajax.stubRequest("/go/api/admin/artifact_stores").andReturn(artifactStoreResponse());

    ArtifactStoresCRUD.create(ArtifactStore.fromJSON(ArtifactStoreTestData.dockerArtifactStore()));

    const request = jasmine.Ajax.requests.mostRecent();
    expect(request.url).toEqual("/go/api/admin/artifact_stores");
    expect(request.method).toEqual("POST");
    expect(request.data()).toEqual(toJSON(ArtifactStoreTestData.dockerArtifactStore()));
    expect(request.requestHeaders.Accept).toEqual("application/vnd.go.cd.v1+json");
    expect(request.requestHeaders["Content-Type"]).toEqual("application/json; charset=utf-8");
  });
開發者ID:GaneshSPatil,項目名稱:gocd,代碼行數:12,代碼來源:artifact_stores_crud_spec.ts


注:本文中的models/artifact_stores/spec/test_data.ArtifactStoreTestData類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。