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

Method test_glob_literal

Lib/test/test_glob.py:116–131  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 self.assertEqual(sorted(l1), sorted(l2))
115
116 def test_glob_literal(self):
117 eq = self.assertSequencesEqual_noorder
118 eq(self.glob('a'), [self.norm('a')])
119 eq(self.glob('a', 'D'), [self.norm('a', 'D')])
120 eq(self.glob('aab'), [self.norm('aab')])
121 eq(self.glob('zymurgy'), [])
122
123 res = glob.glob('*')
124 self.assertEqual({type(r) for r in res}, {str})
125 res = glob.glob(os.path.join(os.curdir, '*'))
126 self.assertEqual({type(r) for r in res}, {str})
127
128 res = glob.glob(b'*')
129 self.assertEqual({type(r) for r in res}, {bytes})
130 res = glob.glob(os.path.join(os.fsencode(os.curdir), b'*'))
131 self.assertEqual({type(r) for r in res}, {bytes})
132
133 def test_glob_empty_pattern(self):
134 self.assertEqual(glob.glob(''), [])

Callers

nothing calls this directly

Calls 5

globMethod · 0.95
normMethod · 0.95
eqFunction · 0.85
assertEqualMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected