Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Learn keyring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Oleksiy Kashuba
Learn keyring
Commits
aa3bcd7d
Commit
aa3bcd7d
authored
2 months ago
by
Alex Kashuba
Browse files
Options
Downloads
Patches
Plain Diff
Better None or syntaxis
parent
ceed44de
Branches
thesis/MA_drupp_city-guide
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.py
+1
-4
1 addition, 4 deletions
src/main.py
tests/test_keyring.py
+9
-8
9 additions, 8 deletions
tests/test_keyring.py
with
10 additions
and
12 deletions
src/main.py
+
1
−
4
View file @
aa3bcd7d
...
...
@@ -5,10 +5,7 @@ import sys
def
parse_credentials
(
url
):
result
=
urlparse
(
url
)
if
result
.
username
is
None
:
username
=
getpass
.
getuser
()
else
:
username
=
result
.
username
username
=
result
.
username
or
getpass
.
getuser
()
if
result
.
port
is
None
:
hostname
=
result
.
hostname
else
:
...
...
This diff is collapsed.
Click to expand it.
tests/test_keyring.py
+
9
−
8
View file @
aa3bcd7d
...
...
@@ -3,16 +3,17 @@ from pytest import fixture, mark
from
main
import
parse_credentials
import
sys
,
os
@fixture
def
ex_whoami
(
ex_user
):
if
ex_user
is
None
:
@fixture
(
scope
=
'
session
'
)
def
whoami
():
if
sys
.
platform
==
'
darwin
'
:
return
os
.
getenv
(
'
USER
'
)
else
:
return
os
.
getlogin
()
else
:
return
ex_user
@fixture
def
ex_whoami
(
ex_user
,
whoami
):
return
ex_user
or
whoami
@fixture
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment