-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(carthage): use latest swift sdk core
- Loading branch information
1 parent
e3eb2c1
commit d885cd5
Showing
2 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |