def test_exclusion_order(self):
     """test that ordering of exclusion patterns does not matter"""
     patterns = [u'static/**/*.html', u'!static/**/versionable.html']
     globster = ExceptionGlobster(patterns)
     self.assertEqual(u'static/**/*.html',
                      globster.match('static/foo.html'))
     self.assertEqual(None, globster.match('static/versionable.html'))
     self.assertEqual(None, globster.match('static/bar/versionable.html'))
     globster = ExceptionGlobster(reversed(patterns))
     self.assertEqual(u'static/**/*.html',
                      globster.match('static/foo.html'))
     self.assertEqual(None, globster.match('static/versionable.html'))
     self.assertEqual(None, globster.match('static/bar/versionable.html'))
 def test_exclusion_patterns(self):
     """test that exception patterns are not matched"""
     patterns = [
         u'*', u'!./local', u'!./local/**/*', u'!RE:\.z.*',
         u'!!./.zcompdump'
     ]
     globster = ExceptionGlobster(patterns)
     self.assertEqual(u'*', globster.match('tmp/foo.txt'))
     self.assertEqual(None, globster.match('local'))
     self.assertEqual(None, globster.match('local/bin/wombat'))
     self.assertEqual(None, globster.match('.zshrc'))
     self.assertEqual(None, globster.match('.zfunctions/fiddle/flam'))
     self.assertEqual(u'!!./.zcompdump', globster.match('.zcompdump'))