MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_glob_literal

Method test_glob_literal

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

globMethod · 0.95
normMethod · 0.95
fsencodeMethod · 0.80
eqFunction · 0.50
assertEqualMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected