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

Method test_macros

Lib/test/test_netrc.py:41–57  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 self.assertEqual(nrc.hosts['default'], ('log2', 'acct2', 'pass2'))
40
41 def test_macros(self):
42 data = """\
43 macdef macro1
44 line1
45 line2
46
47 macdef macro2
48 line3
49 line4
50
51 """
52 nrc = self.make_nrc(data)
53 self.assertEqual(nrc.macros, {'macro1': ['line1\n', 'line2\n'],
54 'macro2': ['line3\n', 'line4\n']})
55 # strip the last \n
56 self.assertRaises(netrc.NetrcParseError, self.make_nrc,
57 data.rstrip(' ')[:-1])
58
59 def test_optional_tokens(self):
60 data = (

Callers

nothing calls this directly

Calls 4

make_nrcMethod · 0.95
assertEqualMethod · 0.45
assertRaisesMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected