Skip to content

Commit

Permalink
build(carthage): use latest swift sdk core
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-arn authored and apaparazzi0329 committed Aug 20, 2020
1 parent e3eb2c1 commit d885cd5
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "IBM/swift-sdk-core" "1.0.0"
github "IBM/swift-sdk-core" "1.1.0"
github "daltoniam/Starscream" "3.0.5"
51 changes: 51 additions & 0 deletions Source/DiscoveryV2/Tests/DiscoveryV2CPDTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@


import XCTest
import Foundation
// Do not import @testable to ensure only public interface is exposed
import DiscoveryV2

class DiscoveryCPDTests: XCTestCase {
private var discovery: Discovery!
private var projectID: String!
private var collectionID: String!
private let timeout: TimeInterval = 30.0

// MARK: - Test Configuration

override func setUp() {
super.setUp()
continueAfterFailure = false
instantiateDiscovery()
}

func instantiateDiscovery() {
let authenticator = WatsonCloudPakForDataAuthenticator(username: WatsonCredentials.DiscoveryV2CPDUsername, password: WatsonCredentials.DiscoveryV2CPDPassword, url: WatsonCredentials.DiscoveryV2CPDURL)

authenticator.disableSSLVerification()

discovery = Discovery(version: "2020-08-12", authenticator: authenticator)

// discovery.serviceURL = WatsonCredentials.DiscoveryV2CPDServiceURL
discovery.serviceURL = "http://localhost:9009"

discovery.defaultHeaders["X-Watson-Learning-Opt-Out"] = "true"
discovery.defaultHeaders["X-Watson-Test"] = "true"

discovery.disableSSLVerification()

projectID = WatsonCredentials.DiscoveryV2CPDTestProjectID
collectionID = WatsonCredentials.DiscoveryV2CPDTestCollectionID
}

func loadDocument(name: String, ext: String) -> Data? {
#if os(Linux)
let url = URL(fileURLWithPath: "Tests/DiscoveryV2Tests/Resources/" + name + "." + ext)
#else
let bundle = Bundle(for: type(of: self))
guard let url = bundle.url(forResource: name, withExtension: ext) else { return nil }
#endif
let data = try? Data(contentsOf: url)
return data
}
}

0 comments on commit d885cd5

Please sign in to comment.