Skip to content

Commit

Permalink
let tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlui committed Dec 19, 2016
1 parent 610604f commit 16f8cd4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Example/PitayaExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
46C7CAC71B04AA4000CC3B70 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 46C7CAC51B04AA4000CC3B70 /* Main.storyboard */; };
46C7CAC91B04AA4000CC3B70 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 46C7CAC81B04AA4000CC3B70 /* Images.xcassets */; };
46C7CACC1B04AA4000CC3B70 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 46C7CACA1B04AA4000CC3B70 /* LaunchScreen.xib */; };
B884D1A61E07B7E70008F5AB /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = B884D1A51E07B7E70008F5AB /* [email protected] */; };
C892C3DA1BC24C8E00406ED5 /* Pitaya.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C892C3D71BC24C8000406ED5 /* Pitaya.framework */; };
C892C3DB1BC24C8E00406ED5 /* Pitaya.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C892C3D71BC24C8000406ED5 /* Pitaya.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
C8CF50521E02CCC00059B9DE /* RootTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8CF50511E02CCC00059B9DE /* RootTableViewController.swift */; };
C8E781F91D9506D20083A9F7 /* lvwenhancom.cer in Resources */ = {isa = PBXBuildFile; fileRef = C8E781F81D9506D20083A9F7 /* lvwenhancom.cer */; };
C8E781FB1D9507490083A9F7 /* logo.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C8E781FA1D9507490083A9F7 /* logo.jpg */; };
C8F84A061E03DCBF005A063C /* ExamplesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8F84A051E03DCBF005A063C /* ExamplesViewController.swift */; };
C8F84A091E03E485005A063C /* SwiftNotice.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8F84A081E03E485005A063C /* SwiftNotice.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -65,10 +65,10 @@
46C7CAC61B04AA4000CC3B70 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
46C7CAC81B04AA4000CC3B70 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
46C7CACB1B04AA4000CC3B70 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
B884D1A51E07B7E70008F5AB /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = "[email protected]"; path = "../../assets/[email protected]"; sourceTree = "<group>"; };
C892C3D11BC24C8000406ED5 /* Pitaya.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Pitaya.xcodeproj; path = ../Pitaya.xcodeproj; sourceTree = "<group>"; };
C8CF50511E02CCC00059B9DE /* RootTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootTableViewController.swift; sourceTree = "<group>"; };
C8E781F81D9506D20083A9F7 /* lvwenhancom.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = lvwenhancom.cer; path = ../assets/lvwenhancom.cer; sourceTree = "<group>"; };
C8E781FA1D9507490083A9F7 /* logo.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = logo.jpg; path = ../../assets/logo.jpg; sourceTree = "<group>"; };
C8F84A051E03DCBF005A063C /* ExamplesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExamplesViewController.swift; sourceTree = "<group>"; };
C8F84A081E03E485005A063C /* SwiftNotice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftNotice.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -121,7 +121,7 @@
46C7CABF1B04AA4000CC3B70 /* Supporting Files */ = {
isa = PBXGroup;
children = (
C8E781FA1D9507490083A9F7 /* logo.jpg */,
B884D1A51E07B7E70008F5AB /* logo@2x.jpg */,
46C7CAC01B04AA4000CC3B70 /* Info.plist */,
);
name = "Supporting Files";
Expand Down Expand Up @@ -222,8 +222,8 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B884D1A61E07B7E70008F5AB /* [email protected] in Resources */,
46C7CAC71B04AA4000CC3B70 /* Main.storyboard in Resources */,
C8E781FB1D9507490083A9F7 /* logo.jpg in Resources */,
46C7CACC1B04AA4000CC3B70 /* LaunchScreen.xib in Resources */,
46C7CAC91B04AA4000CC3B70 /* Images.xcassets in Resources */,
C8E781F91D9506D20083A9F7 /* lvwenhancom.cer in Resources */,
Expand Down
Binary file not shown.
6 changes: 3 additions & 3 deletions Example/PitayaExample/ExamplesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ExamplesViewController: UIViewController {
}
}
func UploadFilesByURL() {
let fileURL = Bundle(for: ExamplesViewController.self).url(forResource: "logo", withExtension: "jpg")!
let fileURL = Bundle(for: ExamplesViewController.self).url(forResource: "logo@2x", withExtension: "jpg")!
let file = File(name: "file", url: fileURL)

self.pleaseWait()
Expand All @@ -86,7 +86,7 @@ class ExamplesViewController: UIViewController {
})
}
func UploadFilesByData() {
let fileURL = Bundle(for: ExamplesViewController.self).url(forResource: "logo", withExtension: "jpg")!
let fileURL = Bundle(for: ExamplesViewController.self).url(forResource: "logo@2x", withExtension: "jpg")!
let data = try! Data(contentsOf: fileURL)
let file = File(name: "file", data: data, type: "jpg")

Expand Down Expand Up @@ -155,7 +155,7 @@ class ExamplesViewController: UIViewController {
let certURL0 = Bundle(for: ExamplesViewController.self).url(forResource: "lvwenhancom", withExtension: "cer")!
let certData0 = try! Data(contentsOf: certURL0)

let certURL1 = Bundle(for: ExamplesViewController.self).url(forResource: "logo", withExtension: "jpg")!
let certURL1 = Bundle(for: ExamplesViewController.self).url(forResource: "logo@2x", withExtension: "jpg")!
let certData1 = try! Data(contentsOf: certURL1)

self.pleaseWait()
Expand Down
8 changes: 4 additions & 4 deletions Pitaya.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
463712111B04C2050019E1AB /* Pitaya.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 463712051B04C2050019E1AB /* Pitaya.framework */; };
8E610C4E1BD0A95D00CF9982 /* AddHTTPHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E610C4D1BD0A95D00CF9982 /* AddHTTPHeader.swift */; };
8EDD226B1B623B4600FAD39F /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EDD226A1B623B4600FAD39F /* BaseTestCase.swift */; };
C83BDDBB1D8FA00D0051D3D6 /* logo.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C83BDDB91D8FA00D0051D3D6 /* logo.jpg */; };
B884D1A81E07B8EB0008F5AB /* logo@2x.jpg in Resources */ = {isa = PBXBuildFile; fileRef = B884D1A71E07B8EB0008F5AB /* logo@2x.jpg */; };
C83BDDBC1D8FA00D0051D3D6 /* lvwenhancom.cer in Resources */ = {isa = PBXBuildFile; fileRef = C83BDDBA1D8FA00D0051D3D6 /* lvwenhancom.cer */; };
C84B22801BCA1D0B00594876 /* SetHTTPBodyRaw.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84B227F1BCA1D0B00594876 /* SetHTTPBodyRaw.swift */; };
C855F3721BC8247B00170211 /* ResponseJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = C855F3711BC8247B00170211 /* ResponseJSON.swift */; };
Expand Down Expand Up @@ -55,7 +55,7 @@
463712161B04C2050019E1AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8E610C4D1BD0A95D00CF9982 /* AddHTTPHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddHTTPHeader.swift; sourceTree = "<group>"; };
8EDD226A1B623B4600FAD39F /* BaseTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTestCase.swift; sourceTree = "<group>"; };
C83BDDB91D8FA00D0051D3D6 /* logo.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = logo.jpg; path = assets/logo.jpg; sourceTree = SOURCE_ROOT; };
B884D1A71E07B8EB0008F5AB /* logo@2x.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = "logo@2x.jpg"; path = "assets/logo@2x.jpg"; sourceTree = SOURCE_ROOT; };
C83BDDBA1D8FA00D0051D3D6 /* lvwenhancom.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = lvwenhancom.cer; path = assets/lvwenhancom.cer; sourceTree = SOURCE_ROOT; };
C84B227F1BCA1D0B00594876 /* SetHTTPBodyRaw.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetHTTPBodyRaw.swift; sourceTree = "<group>"; };
C855F3711BC8247B00170211 /* ResponseJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseJSON.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -159,7 +159,7 @@
C84B227F1BCA1D0B00594876 /* SetHTTPBodyRaw.swift */,
C88EE1671BC3A6F10033D3B0 /* AddSSLPinning.swift */,
C855F3711BC8247B00170211 /* ResponseJSON.swift */,
C83BDDB91D8FA00D0051D3D6 /* logo.jpg */,
B884D1A71E07B8EB0008F5AB /* logo@2x.jpg */,
C83BDDBA1D8FA00D0051D3D6 /* lvwenhancom.cer */,
463712151B04C2050019E1AB /* Supporting Files */,
);
Expand Down Expand Up @@ -287,7 +287,7 @@
buildActionMask = 2147483647;
files = (
C83BDDBC1D8FA00D0051D3D6 /* lvwenhancom.cer in Resources */,
C83BDDBB1D8FA00D0051D3D6 /* logo.jpg in Resources */,
B884D1A81E07B8EB0008F5AB /* logo@2x.jpg in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions PitayaTests/AddFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Pitaya
class AddFiles: BaseTestCase {

func testAddOneFile() {
let file = File(name: "file", url: self.URLForResource("logo", withExtension: "jpg"))
let file = File(name: "file", url: self.URLForResource("logo@2x", withExtension: "jpg"))

let expectation = self.expectation(description: "testAddOneFile")
Pita.build(HTTPMethod: .POST, url: "http://staticonsae.sinaapp.com/pitaya.php")
Expand All @@ -31,7 +31,7 @@ class AddFiles: BaseTestCase {
}

func testAddOneFileInData() {
let data = try! Data(contentsOf: self.URLForResource("logo", withExtension: "jpg"))
let data = try! Data(contentsOf: self.URLForResource("logo@2x", withExtension: "jpg"))
let file = File(name: "file", data: data, type: "jpg")

let expectation = self.expectation(description: "testAddOneFileInData")
Expand All @@ -53,7 +53,7 @@ class AddFiles: BaseTestCase {
func testOneMoreThing() {
// code here will not be used in reality forever, just for increasing testing coverage

let file = File(name: "file", url: self.URLForResource("logo", withExtension: "jpg"))
let file = File(name: "file", url: self.URLForResource("logo@2x", withExtension: "jpg"))

let expectation = self.expectation(description: "testOneMoreThing")
Pita.build(HTTPMethod: .GET, url: "http://staticonsae.sinaapp.com/pitaya.php")
Expand All @@ -71,7 +71,7 @@ class AddFiles: BaseTestCase {
func testOneMoreThingInData() {
// code here will not be used in reality forever, just for increasing testing coverage

let data = try! Data(contentsOf: self.URLForResource("logo", withExtension: "jpg"))
let data = try! Data(contentsOf: self.URLForResource("logo@2x", withExtension: "jpg"))
let file = File(name: "file", data: data, type: "jpg")

let expectation = self.expectation(description: "testOneMoreThingInData")
Expand Down
2 changes: 1 addition & 1 deletion PitayaTests/AddSSLPinning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AddSSLPinning: BaseTestCase {
override func setUp() {
super.setUp()
self.certData = try! Data(contentsOf: self.URLForResource("lvwenhancom", withExtension: "cer"))
self.certData1 = try! Data(contentsOf: self.URLForResource("logo", withExtension: "jpg"))
self.certData1 = try! Data(contentsOf: self.URLForResource("logo@2x", withExtension: "jpg"))
self.certData2 = "Pitaya".data(using: String.Encoding.utf8)
}

Expand Down

0 comments on commit 16f8cd4

Please sign in to comment.