MCPcopy Index your code
hub / github.com/python/cpython / make_nrc

Method make_nrc

Lib/test/test_netrc.py:12–23  ·  view source on GitHub ↗
(self, test_data)

Source from the content-addressed store, hash-verified

10class NetrcTestCase(unittest.TestCase):
11
12 def make_nrc(self, test_data):
13 test_data = textwrap.dedent(test_data)
14 mode = 'w'
15 if sys.platform != 'cygwin':
16 mode += 't'
17 with open(temp_filename, mode, encoding="utf-8") as fp:
18 fp.write(test_data)
19 try:
20 nrc = netrc.netrc(temp_filename)
21 finally:
22 os.unlink(temp_filename)
23 return nrc
24
25 def test_toplevel_non_ordered_tokens(self):
26 nrc = self.make_nrc("""\

Callers 6

test_toplevel_tokensMethod · 0.95
test_macrosMethod · 0.95
test_optional_tokensMethod · 0.95
_test_token_xMethod · 0.95
_test_commentMethod · 0.95

Calls 4

openFunction · 0.50
dedentMethod · 0.45
writeMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected