Example #1
0
  def test_is_basename_open_sourced_conflict(self):
    def _test_in_and_out(rules):
      self.assertTrue(open_source.is_basename_open_sourced('in', rules))
      self.assertFalse(open_source.is_basename_open_sourced('out', rules))

    def _test_out_and_out2(rules):
      self.assertFalse(open_source.is_basename_open_sourced('out', rules))
      self.assertFalse(open_source.is_basename_open_sourced('out2', rules))

    self.assertFalse(open_source.is_basename_open_sourced('foo',
                                                          ['foo', '!foo']))
    _test_in_and_out(['*', '!out'])
    _test_in_and_out(['!out', '*'])
    _test_in_and_out(['in', 'out', '!out'])
    _test_out_and_out2(['out', '!*'])
    _test_out_and_out2(['!*', 'out'])
Example #2
0
    def test_is_basename_open_sourced_conflict(self):
        def _test_in_and_out(rules):
            self.assertTrue(open_source.is_basename_open_sourced('in', rules))
            self.assertFalse(open_source.is_basename_open_sourced(
                'out', rules))

        def _test_out_and_out2(rules):
            self.assertFalse(open_source.is_basename_open_sourced(
                'out', rules))
            self.assertFalse(
                open_source.is_basename_open_sourced('out2', rules))

        self.assertFalse(
            open_source.is_basename_open_sourced('foo', ['foo', '!foo']))
        _test_in_and_out(['*', '!out'])
        _test_in_and_out(['!out', '*'])
        _test_in_and_out(['in', 'out', '!out'])
        _test_out_and_out2(['out', '!*'])
        _test_out_and_out2(['!*', 'out'])
Example #3
0
 def _test_out_and_out2(rules):
   self.assertFalse(open_source.is_basename_open_sourced('out', rules))
   self.assertFalse(open_source.is_basename_open_sourced('out2', rules))
Example #4
0
 def _test_in_and_out(rules):
   self.assertTrue(open_source.is_basename_open_sourced('in', rules))
   self.assertFalse(open_source.is_basename_open_sourced('out', rules))
Example #5
0
 def test_is_basename_open_sourced_bang_means_not(self):
   self.assertFalse(open_source.is_basename_open_sourced('!foo', ['!foo']))
Example #6
0
 def test_is_basename_open_sourced_false(self):
   for p in ['', 'other', 'foobar.h', 'xfoobar.c', 'subdir2']:
     self.assertFalse(open_source.is_basename_open_sourced(p, self.RULES))
Example #7
0
 def test_is_basename_open_sourced_true(self):
   for p in ['foobar.c', 'foobar.cpp', 'subdir']:
     self.assertTrue(open_source.is_basename_open_sourced(p, self.RULES))
Example #8
0
 def _test_out_and_out2(rules):
     self.assertFalse(open_source.is_basename_open_sourced(
         'out', rules))
     self.assertFalse(
         open_source.is_basename_open_sourced('out2', rules))
Example #9
0
 def _test_in_and_out(rules):
     self.assertTrue(open_source.is_basename_open_sourced('in', rules))
     self.assertFalse(open_source.is_basename_open_sourced(
         'out', rules))
Example #10
0
 def test_is_basename_open_sourced_bang_means_not(self):
     self.assertFalse(open_source.is_basename_open_sourced(
         '!foo', ['!foo']))
Example #11
0
 def test_is_basename_open_sourced_false(self):
     for p in ['', 'other', 'foobar.h', 'xfoobar.c', 'subdir2']:
         self.assertFalse(
             open_source.is_basename_open_sourced(p, self.RULES))
Example #12
0
 def test_is_basename_open_sourced_true(self):
     for p in ['foobar.c', 'foobar.cpp', 'subdir']:
         self.assertTrue(open_source.is_basename_open_sourced(
             p, self.RULES))