Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
808e50f4
Commit
808e50f4
authored
Mar 22, 2002
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a simple test suite for netrc.py, and remove it from test_sundry
parent
0e99567f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
Lib/test/test_netrc.py
Lib/test/test_netrc.py
+43
-0
Lib/test/test_sundry.py
Lib/test/test_sundry.py
+0
-1
No files found.
Lib/test/test_netrc.py
0 → 100644
View file @
808e50f4
import
netrc
,
os
,
tempfile
,
test_support
,
unittest
TEST_NETRC
=
"""
machine foo login log1 password pass1 account acct1
macdef macro1
line1
line2
macdef macro2
line3
line4
default login log2 password pass2
"""
temp_filename
=
tempfile
.
mktemp
()
class
NetrcTestCase
(
unittest
.
TestCase
):
def
setUp
(
self
):
fp
=
open
(
temp_filename
,
'wt'
)
fp
.
write
(
TEST_NETRC
)
fp
.
close
()
self
.
netrc
=
netrc
.
netrc
(
temp_filename
)
def
tearDown
(
self
):
del
self
.
netrc
os
.
unlink
(
temp_filename
)
def
test_case_1
(
self
):
self
.
assert_
(
self
.
netrc
.
macros
==
{
'macro1'
:[
'line1
\
n
'
,
'line2
\
n
'
],
'macro2'
:[
'line3
\
n
'
,
'line4
\
n
'
]}
)
self
.
assert_
(
self
.
netrc
.
hosts
[
'foo'
]
==
(
'log1'
,
'acct1'
,
'pass1'
))
self
.
assert_
(
self
.
netrc
.
hosts
[
'default'
]
==
(
'log2'
,
None
,
'pass2'
))
if
__name__
==
"__main__"
:
test_support
.
run_unittest
(
NetrcTestCase
)
Lib/test/test_sundry.py
View file @
808e50f4
...
...
@@ -55,7 +55,6 @@ import mimetypes
import
mimify
import
multifile
import
mutex
import
netrc
import
nntplib
import
nturl2path
import
pdb
...
...
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