first commit
This commit is contained in:
commit
5aa900eacd
18
main.py
Normal file
18
main.py
Normal file
@ -0,0 +1,18 @@
|
||||
import requests
|
||||
import json
|
||||
import base64
|
||||
from requests.auth import HTTPBasicAuth
|
||||
auth = HTTPBasicAuth('chubby', '81Iexqpxe!')
|
||||
body = {
|
||||
"name": "TEST2",
|
||||
}
|
||||
get_repos = requests.get("https://git.omg.team/api/v1/repos/chubby/TEST2", auth=auth)
|
||||
|
||||
if get_repos.status_code==404:
|
||||
|
||||
repository = requests.post("https://git.omg.team/api/v1/user/repos", auth=auth, json=body)
|
||||
assert repository.status_code==201
|
||||
|
||||
file_cont = base64.b64encode(b'tra-ta-ta-ta-ta')
|
||||
body = {"content":file_cont.decode('ascii')}
|
||||
file = requests.post("https://git.omg.team/api/v1/repos/chubby/TEST2/contents/test.txt", auth=auth, json=body)
|
Loading…
x
Reference in New Issue
Block a user