Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-sshkey
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
b397c937
authored
Oct 09, 2014
by
Paul Kilgo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix more unecessary saves
parent
abee0c60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
17 deletions
+4
-17
django_sshkey/tests.py
+4
-17
No files found.
django_sshkey/tests.py
View file @
b397c937
...
@@ -227,14 +227,14 @@ class NamedKeyTestCase(BaseTestCase):
...
@@ -227,14 +227,14 @@ class NamedKeyTestCase(BaseTestCase):
# key1 has a comment
# key1 has a comment
cls
.
key1_path
=
os
.
path
.
join
(
cls
.
key_dir
,
'key1'
)
cls
.
key1_path
=
os
.
path
.
join
(
cls
.
key_dir
,
'key1'
)
ssh_keygen
(
comment
=
'comment'
,
file
=
cls
.
key1_path
)
ssh_keygen
(
comment
=
'comment'
,
file
=
cls
.
key1_path
)
cls
.
key1
=
Key
(
key
=
open
(
cls
.
key1_path
+
'.pub'
)
.
read
())
cls
.
key1
=
TestNamedKey
.
base
(
key
=
open
(
cls
.
key1_path
+
'.pub'
)
.
read
())
cls
.
key1
.
full_clean
()
cls
.
key1
.
full_clean
()
cls
.
key1
.
save
()
cls
.
key1
.
save
()
# key2 does not have a comment
# key2 does not have a comment
cls
.
key2_path
=
os
.
path
.
join
(
cls
.
key_dir
,
'key2'
)
cls
.
key2_path
=
os
.
path
.
join
(
cls
.
key_dir
,
'key2'
)
ssh_keygen
(
comment
=
''
,
file
=
cls
.
key2_path
)
ssh_keygen
(
comment
=
''
,
file
=
cls
.
key2_path
)
cls
.
key2
=
Key
(
key
=
open
(
cls
.
key2_path
+
'.pub'
)
.
read
())
cls
.
key2
=
TestNamedKey
.
base
(
key
=
open
(
cls
.
key2_path
+
'.pub'
)
.
read
())
cls
.
key2
.
full_clean
()
cls
.
key2
.
full_clean
()
cls
.
key2
.
save
()
cls
.
key2
.
save
()
...
@@ -296,10 +296,10 @@ class UserKeyTestCase(BaseTestCase):
...
@@ -296,10 +296,10 @@ class UserKeyTestCase(BaseTestCase):
ssh_keygen
(
comment
=
'comment'
,
file
=
cls
.
key3_path
)
ssh_keygen
(
comment
=
'comment'
,
file
=
cls
.
key3_path
)
# make the Key models
# make the Key models
cls
.
key1
=
Key
(
key
=
open
(
cls
.
key1_path
+
'.pub'
)
.
read
())
cls
.
key1
=
UserKey
.
base
(
key
=
open
(
cls
.
key1_path
+
'.pub'
)
.
read
())
cls
.
key1
.
full_clean
()
cls
.
key1
.
full_clean
()
cls
.
key1
.
save
()
cls
.
key1
.
save
()
cls
.
key2
=
Key
(
key
=
open
(
cls
.
key2_path
+
'.pub'
)
.
read
())
cls
.
key2
=
UserKey
.
base
(
key
=
open
(
cls
.
key2_path
+
'.pub'
)
.
read
())
cls
.
key2
.
full_clean
()
cls
.
key2
.
full_clean
()
cls
.
key2
.
save
()
cls
.
key2
.
save
()
...
@@ -408,22 +408,16 @@ class RFC4716TestCase(BaseTestCase):
...
@@ -408,22 +408,16 @@ class RFC4716TestCase(BaseTestCase):
def
test_import_with_comment
(
self
):
def
test_import_with_comment
(
self
):
key
=
Key
(
key
=
Key
(
#user = self.user1,
#name = 'name',
key
=
open
(
self
.
key1_rfc4716_path
)
.
read
(),
key
=
open
(
self
.
key1_rfc4716_path
)
.
read
(),
)
)
key
.
full_clean
()
key
.
full_clean
()
key
.
save
()
self
.
assertEqual
(
key
.
key
.
split
()[:
2
],
open
(
self
.
key1_path
+
'.pub'
)
.
read
()
.
split
()[:
2
])
self
.
assertEqual
(
key
.
key
.
split
()[:
2
],
open
(
self
.
key1_path
+
'.pub'
)
.
read
()
.
split
()[:
2
])
def
test_import_without_comment
(
self
):
def
test_import_without_comment
(
self
):
key
=
Key
(
key
=
Key
(
#user = self.user1,
#name = 'name',
key
=
open
(
self
.
key2_rfc4716_path
)
.
read
(),
key
=
open
(
self
.
key2_rfc4716_path
)
.
read
(),
)
)
key
.
full_clean
()
key
.
full_clean
()
key
.
save
()
self
.
assertEqual
(
key
.
key
.
split
()[:
2
],
open
(
self
.
key2_path
+
'.pub'
)
.
read
()
.
split
()[:
2
])
self
.
assertEqual
(
key
.
key
.
split
()[:
2
],
open
(
self
.
key2_path
+
'.pub'
)
.
read
()
.
split
()[:
2
])
def
test_export
(
self
):
def
test_export
(
self
):
...
@@ -433,7 +427,6 @@ class RFC4716TestCase(BaseTestCase):
...
@@ -433,7 +427,6 @@ class RFC4716TestCase(BaseTestCase):
key
=
open
(
self
.
key1_path
+
'.pub'
)
.
read
(),
key
=
open
(
self
.
key1_path
+
'.pub'
)
.
read
(),
)
)
key
.
full_clean
()
key
.
full_clean
()
key
.
save
()
export_path
=
os
.
path
.
join
(
self
.
key_dir
,
'export'
)
export_path
=
os
.
path
.
join
(
self
.
key_dir
,
'export'
)
import_path
=
os
.
path
.
join
(
self
.
key_dir
,
'import'
)
import_path
=
os
.
path
.
join
(
self
.
key_dir
,
'import'
)
with
open
(
export_path
,
'w'
)
as
f
:
with
open
(
export_path
,
'w'
)
as
f
:
...
@@ -461,22 +454,16 @@ class PemTestCase(BaseTestCase):
...
@@ -461,22 +454,16 @@ class PemTestCase(BaseTestCase):
def
test_import
(
self
):
def
test_import
(
self
):
key
=
Key
(
key
=
Key
(
#user = self.user1,
#name = 'name',
key
=
open
(
self
.
key1_pem_path
)
.
read
(),
key
=
open
(
self
.
key1_pem_path
)
.
read
(),
)
)
key
.
full_clean
()
key
.
full_clean
()
key
.
save
()
self
.
assertEqual
(
key
.
key
.
split
()[:
2
],
open
(
self
.
key1_path
+
'.pub'
)
.
read
()
.
split
()[:
2
])
self
.
assertEqual
(
key
.
key
.
split
()[:
2
],
open
(
self
.
key1_path
+
'.pub'
)
.
read
()
.
split
()[:
2
])
def
test_export
(
self
):
def
test_export
(
self
):
key
=
Key
(
key
=
Key
(
#user = self.user1,
#name = 'name',
key
=
open
(
self
.
key1_path
+
'.pub'
)
.
read
(),
key
=
open
(
self
.
key1_path
+
'.pub'
)
.
read
(),
)
)
key
.
full_clean
()
key
.
full_clean
()
key
.
save
()
export_path
=
os
.
path
.
join
(
self
.
key_dir
,
'export'
)
export_path
=
os
.
path
.
join
(
self
.
key_dir
,
'export'
)
import_path
=
os
.
path
.
join
(
self
.
key_dir
,
'import'
)
import_path
=
os
.
path
.
join
(
self
.
key_dir
,
'import'
)
with
open
(
export_path
,
'w'
)
as
f
:
with
open
(
export_path
,
'w'
)
as
f
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment