diff --git a/tests/integration/cassettes/test_gogs_test_01_create__already_exists.json b/tests/integration/cassettes/test_gogs_test_01_create__already_exists.json index f62c421..43b61b0 100644 --- a/tests/integration/cassettes/test_gogs_test_01_create__already_exists.json +++ b/tests/integration/cassettes/test_gogs_test_01_create__already_exists.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } }, { @@ -53,7 +53,7 @@ "User-Agent": "python-requests/2.12.4" }, "method": "POST", - "uri": "http://127.0.0.1:3000/api/v1/user/repos?token=" + "uri": "/api/v1/user/repos?token=" }, "response": { "body": { @@ -71,7 +71,7 @@ "code": 422, "message": "Unprocessable Entity" }, - "url": "http://127.0.0.1:3000/api/v1/user/repos?token=" + "url": "/api/v1/user/repos?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_01_create__new.json b/tests/integration/cassettes/test_gogs_test_01_create__new.json index 77175c1..1f450de 100644 --- a/tests/integration/cassettes/test_gogs_test_01_create__new.json +++ b/tests/integration/cassettes/test_gogs_test_01_create__new.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } }, { @@ -53,12 +53,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "POST", - "uri": "http://127.0.0.1:3000/api/v1/user/repos?token=" + "uri": "/api/v1/user/repos?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":4,\"owner\":{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"},\"name\":\"foobar\",\"full_name\":\"/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"http://127.0.0.1:3000//foobar\",\"ssh_url\":\"ssh://git@:3022//foobar.git\",\"clone_url\":\"http://127.0.0.1:3000//foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":0,\"open_issues_count\":0,\"default_branch\":\"\",\"created_at\":\"0001-01-01T00:00:00Z\",\"updated_at\":\"0001-01-01T00:00:00Z\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" + "string": "{\"id\":4,\"owner\":{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"},\"name\":\"foobar\",\"full_name\":\"/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"//foobar\",\"ssh_url\":\"ssh://git@:3022//foobar.git\",\"clone_url\":\"//foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":0,\"open_issues_count\":0,\"default_branch\":\"\",\"created_at\":\"0001-01-01T00:00:00Z\",\"updated_at\":\"0001-01-01T00:00:00Z\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" }, "headers": { "Content-Length": "667", @@ -71,7 +71,7 @@ "code": 201, "message": "Created" }, - "url": "http://127.0.0.1:3000/api/v1/user/repos?token=" + "url": "/api/v1/user/repos?token=" } }, { @@ -89,12 +89,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/repos//foobar?token=" + "uri": "/api/v1/repos//foobar?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":4,\"owner\":{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"},\"name\":\"foobar\",\"full_name\":\"/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"http://127.0.0.1:3000//foobar\",\"ssh_url\":\"ssh://git@:3022//foobar.git\",\"clone_url\":\"http://127.0.0.1:3000//foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":1,\"open_issues_count\":0,\"default_branch\":\"master\",\"created_at\":\"2017-01-21T17:04:07+03:00\",\"updated_at\":\"2017-01-21T17:04:07+03:00\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" + "string": "{\"id\":4,\"owner\":{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"},\"name\":\"foobar\",\"full_name\":\"/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"//foobar\",\"ssh_url\":\"ssh://git@:3022//foobar.git\",\"clone_url\":\"//foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":1,\"open_issues_count\":0,\"default_branch\":\"master\",\"created_at\":\"2017-01-21T17:04:07+03:00\",\"updated_at\":\"2017-01-21T17:04:07+03:00\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" }, "headers": { "Content-Length": "683", @@ -107,7 +107,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/repos//foobar?token=" + "url": "/api/v1/repos//foobar?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_01_create_group__already_exists.json b/tests/integration/cassettes/test_gogs_test_01_create_group__already_exists.json index ee5b03b..b2591df 100644 --- a/tests/integration/cassettes/test_gogs_test_01_create_group__already_exists.json +++ b/tests/integration/cassettes/test_gogs_test_01_create_group__already_exists.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } }, { @@ -51,12 +51,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user/orgs?token=" + "uri": "/api/v1/user/orgs?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "[{\"id\":4,\"username\":\"guyzmo\",\"full_name\":\"\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/4\",\"description\":\"\",\"website\":\"\",\"location\":\"\"}]" + "string": "[{\"id\":4,\"username\":\"guyzmo\",\"full_name\":\"\",\"avatar_url\":\"/avatars/4\",\"description\":\"\",\"website\":\"\",\"location\":\"\"}]" }, "headers": { "Content-Length": "136", @@ -69,7 +69,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user/orgs?token=" + "url": "/api/v1/user/orgs?token=" } }, { @@ -89,7 +89,7 @@ "User-Agent": "python-requests/2.12.4" }, "method": "POST", - "uri": "http://127.0.0.1:3000/api/v1/org/guyzmo/repos?token=" + "uri": "/api/v1/org/guyzmo/repos?token=" }, "response": { "body": { @@ -107,7 +107,7 @@ "code": 422, "message": "Unprocessable Entity" }, - "url": "http://127.0.0.1:3000/api/v1/org/guyzmo/repos?token=" + "url": "/api/v1/org/guyzmo/repos?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_01_create_group__new.json b/tests/integration/cassettes/test_gogs_test_01_create_group__new.json index 25d4e8c..6767bdf 100644 --- a/tests/integration/cassettes/test_gogs_test_01_create_group__new.json +++ b/tests/integration/cassettes/test_gogs_test_01_create_group__new.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } }, { @@ -51,12 +51,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user/orgs?token=" + "uri": "/api/v1/user/orgs?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "[{\"id\":4,\"username\":\"guyzmo\",\"full_name\":\"\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/4\",\"description\":\"\",\"website\":\"\",\"location\":\"\"}]" + "string": "[{\"id\":4,\"username\":\"guyzmo\",\"full_name\":\"\",\"avatar_url\":\"/avatars/4\",\"description\":\"\",\"website\":\"\",\"location\":\"\"}]" }, "headers": { "Content-Length": "136", @@ -69,7 +69,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user/orgs?token=" + "url": "/api/v1/user/orgs?token=" } }, { @@ -89,12 +89,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "POST", - "uri": "http://127.0.0.1:3000/api/v1/org/guyzmo/repos?token=" + "uri": "/api/v1/org/guyzmo/repos?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":5,\"owner\":{\"id\":4,\"login\":\"guyzmo\",\"full_name\":\"\",\"email\":\"\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/4\",\"username\":\"guyzmo\"},\"name\":\"foobar\",\"full_name\":\"guyzmo/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"http://127.0.0.1:3000/guyzmo/foobar\",\"ssh_url\":\"ssh://git@:3022/guyzmo/foobar.git\",\"clone_url\":\"http://127.0.0.1:3000/guyzmo/foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":0,\"open_issues_count\":0,\"default_branch\":\"\",\"created_at\":\"0001-01-01T00:00:00Z\",\"updated_at\":\"0001-01-01T00:00:00Z\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" + "string": "{\"id\":5,\"owner\":{\"id\":4,\"login\":\"guyzmo\",\"full_name\":\"\",\"email\":\"\",\"avatar_url\":\"/avatars/4\",\"username\":\"guyzmo\"},\"name\":\"foobar\",\"full_name\":\"guyzmo/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"/guyzmo/foobar\",\"ssh_url\":\"ssh://git@:3022/guyzmo/foobar.git\",\"clone_url\":\"/guyzmo/foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":0,\"open_issues_count\":0,\"default_branch\":\"\",\"created_at\":\"0001-01-01T00:00:00Z\",\"updated_at\":\"0001-01-01T00:00:00Z\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" }, "headers": { "Content-Length": "605", @@ -107,7 +107,7 @@ "code": 201, "message": "Created" }, - "url": "http://127.0.0.1:3000/api/v1/org/guyzmo/repos?token=" + "url": "/api/v1/org/guyzmo/repos?token=" } }, { @@ -125,12 +125,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/repos/guyzmo/foobar?token=" + "uri": "/api/v1/repos/guyzmo/foobar?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":5,\"owner\":{\"id\":4,\"login\":\"guyzmo\",\"full_name\":\"\",\"email\":\"\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/4\",\"username\":\"guyzmo\"},\"name\":\"foobar\",\"full_name\":\"guyzmo/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"http://127.0.0.1:3000/guyzmo/foobar\",\"ssh_url\":\"ssh://git@:3022/guyzmo/foobar.git\",\"clone_url\":\"http://127.0.0.1:3000/guyzmo/foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":2,\"open_issues_count\":0,\"default_branch\":\"master\",\"created_at\":\"2017-01-21T17:04:10+03:00\",\"updated_at\":\"2017-01-21T17:04:10+03:00\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" + "string": "{\"id\":5,\"owner\":{\"id\":4,\"login\":\"guyzmo\",\"full_name\":\"\",\"email\":\"\",\"avatar_url\":\"/avatars/4\",\"username\":\"guyzmo\"},\"name\":\"foobar\",\"full_name\":\"guyzmo/foobar\",\"description\":\"\",\"private\":false,\"fork\":false,\"html_url\":\"/guyzmo/foobar\",\"ssh_url\":\"ssh://git@:3022/guyzmo/foobar.git\",\"clone_url\":\"/guyzmo/foobar.git\",\"website\":\"\",\"stars_count\":0,\"forks_count\":0,\"watchers_count\":2,\"open_issues_count\":0,\"default_branch\":\"master\",\"created_at\":\"2017-01-21T17:04:10+03:00\",\"updated_at\":\"2017-01-21T17:04:10+03:00\",\"permissions\":{\"admin\":true,\"push\":true,\"pull\":true}}" }, "headers": { "Content-Length": "621", @@ -143,7 +143,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/repos/guyzmo/foobar?token=" + "url": "/api/v1/repos/guyzmo/foobar?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_02_delete.json b/tests/integration/cassettes/test_gogs_test_02_delete.json index c5a528c..24af2f6 100644 --- a/tests/integration/cassettes/test_gogs_test_02_delete.json +++ b/tests/integration/cassettes/test_gogs_test_02_delete.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } }, { @@ -52,7 +52,7 @@ "User-Agent": "python-requests/2.12.4" }, "method": "DELETE", - "uri": "http://127.0.0.1:3000/api/v1/repos/guyzmo/foobar?token=" + "uri": "/api/v1/repos/guyzmo/foobar?token=" }, "response": { "body": { @@ -67,7 +67,7 @@ "code": 204, "message": "No Content" }, - "url": "http://127.0.0.1:3000/api/v1/repos/guyzmo/foobar?token=" + "url": "/api/v1/repos/guyzmo/foobar?token=" } }, { @@ -85,7 +85,7 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/repos/guyzmo/foobar?token=" + "uri": "/api/v1/repos/guyzmo/foobar?token=" }, "response": { "body": { @@ -103,7 +103,7 @@ "code": 404, "message": "Not Found" }, - "url": "http://127.0.0.1:3000/api/v1/repos/guyzmo/foobar?token=" + "url": "/api/v1/repos/guyzmo/foobar?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_03_delete_nouser.json b/tests/integration/cassettes/test_gogs_test_03_delete_nouser.json index 3c079af..4e452c5 100644 --- a/tests/integration/cassettes/test_gogs_test_03_delete_nouser.json +++ b/tests/integration/cassettes/test_gogs_test_03_delete_nouser.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } }, { @@ -52,7 +52,7 @@ "User-Agent": "python-requests/2.12.4" }, "method": "DELETE", - "uri": "http://127.0.0.1:3000/api/v1/repos//foobar?token=" + "uri": "/api/v1/repos//foobar?token=" }, "response": { "body": { @@ -67,7 +67,7 @@ "code": 204, "message": "No Content" }, - "url": "http://127.0.0.1:3000/api/v1/repos//foobar?token=" + "url": "/api/v1/repos//foobar?token=" } }, { @@ -85,7 +85,7 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/repos//foobar?token=" + "uri": "/api/v1/repos//foobar?token=" }, "response": { "body": { @@ -103,7 +103,7 @@ "code": 404, "message": "Not Found" }, - "url": "http://127.0.0.1:3000/api/v1/repos//foobar?token=" + "url": "/api/v1/repos//foobar?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_04_clone.json b/tests/integration/cassettes/test_gogs_test_04_clone.json index 5ac4754..88c6a40 100644 --- a/tests/integration/cassettes/test_gogs_test_04_clone.json +++ b/tests/integration/cassettes/test_gogs_test_04_clone.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_05_add.json b/tests/integration/cassettes/test_gogs_test_05_add.json index cd35864..89269e6 100644 --- a/tests/integration/cassettes/test_gogs_test_05_add.json +++ b/tests/integration/cassettes/test_gogs_test_05_add.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_06_add__name.json b/tests/integration/cassettes/test_gogs_test_06_add__name.json index 9eca356..e3d72a7 100644 --- a/tests/integration/cassettes/test_gogs_test_06_add__name.json +++ b/tests/integration/cassettes/test_gogs_test_06_add__name.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_07_add__alone.json b/tests/integration/cassettes/test_gogs_test_07_add__alone.json index 9eca356..e3d72a7 100644 --- a/tests/integration/cassettes/test_gogs_test_07_add__alone.json +++ b/tests/integration/cassettes/test_gogs_test_07_add__alone.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_08_add__alone_name.json b/tests/integration/cassettes/test_gogs_test_08_add__alone_name.json index 9e0cf78..062711f 100644 --- a/tests/integration/cassettes/test_gogs_test_08_add__alone_name.json +++ b/tests/integration/cassettes/test_gogs_test_08_add__alone_name.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_09_add__default.json b/tests/integration/cassettes/test_gogs_test_09_add__default.json index c504d8b..010578d 100644 --- a/tests/integration/cassettes/test_gogs_test_09_add__default.json +++ b/tests/integration/cassettes/test_gogs_test_09_add__default.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_10_add__default_name.json b/tests/integration/cassettes/test_gogs_test_10_add__default_name.json index 450b95f..5da6bd7 100644 --- a/tests/integration/cassettes/test_gogs_test_10_add__default_name.json +++ b/tests/integration/cassettes/test_gogs_test_10_add__default_name.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_11_add__alone_default.json b/tests/integration/cassettes/test_gogs_test_11_add__alone_default.json index 450b95f..5da6bd7 100644 --- a/tests/integration/cassettes/test_gogs_test_11_add__alone_default.json +++ b/tests/integration/cassettes/test_gogs_test_11_add__alone_default.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/cassettes/test_gogs_test_12_add__alone_default_name.json b/tests/integration/cassettes/test_gogs_test_12_add__alone_default_name.json index 8d71128..7956cd0 100644 --- a/tests/integration/cassettes/test_gogs_test_12_add__alone_default_name.json +++ b/tests/integration/cassettes/test_gogs_test_12_add__alone_default_name.json @@ -14,12 +14,12 @@ "User-Agent": "python-requests/2.12.4" }, "method": "GET", - "uri": "http://127.0.0.1:3000/api/v1/user?token=" + "uri": "/api/v1/user?token=" }, "response": { "body": { "encoding": "UTF-8", - "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"http://127.0.0.1:3000/avatars/3\",\"username\":\"\"}" + "string": "{\"id\":3,\"login\":\"\",\"full_name\":\"\",\"email\":\"guyzmo@gogs.loopback\",\"avatar_url\":\"/avatars/3\",\"username\":\"\"}" }, "headers": { "Content-Length": "152", @@ -33,7 +33,7 @@ "code": 200, "message": "OK" }, - "url": "http://127.0.0.1:3000/api/v1/user?token=" + "url": "/api/v1/user?token=" } } ], diff --git a/tests/integration/test_gogs.py b/tests/integration/test_gogs.py index 9d3f39a..8896675 100644 --- a/tests/integration/test_gogs.py +++ b/tests/integration/test_gogs.py @@ -12,15 +12,22 @@ import os import sys import pytest +from urllib.parse import urlparse from tests.helpers import GitRepoTestCase from git_repo.services.service import gogs from git_repo.exceptions import ResourceExistsError +from betamax import Betamax + +GOGS_URL=os.environ.get('GOGS_URL', 'https://try.gogs.io') + +with Betamax.configure() as config: + config.define_cassette_placeholder('', GOGS_URL) + class Test_Gogs(GitRepoTestCase): log = log - fqdn = 'http://127.0.0.1:3000' @property def local_namespace(self): @@ -29,9 +36,14 @@ def local_namespace(self): return 'git-repo-test' def get_service(self): - gogs.GogsService.fqdn = self.fqdn - return gogs.GogsService(c=dict()) - # return gogs.GogsService(c=dict(fqdn=self.fqdn,__name__='gitrepo "gogs"',token=os.environ['PRIVATE_KEY_GOGS'])) + url = urlparse(GOGS_URL) + return gogs.GogsService(c={ + '__name__': 'gitrepo "gogs"', + 'fqdn': url.hostname, + 'port': url.port, + 'scheme': url.scheme, + 'insecure': 'yes', + }) def get_requests_session(self): return self.service.gg.session