def testChangeTestPatterns_NoChange_ReturnsEmptySets(self):
   self.assertEqual(
       (set(), set()),
       edit_config_handler._ChangeTestPatterns([], []))
   self.assertEqual(
       (set(), set()),
       edit_config_handler._ChangeTestPatterns(['a/b/c'], ['a/b/c']))
 def testChangeTestPatterns_NoChange_ReturnsEmptySets(self):
   self.assertEqual(
       (set(), set()),
       edit_config_handler._ChangeTestPatterns([], []))
   self.assertEqual(
       (set(), set()),
       edit_config_handler._ChangeTestPatterns(['a/b/c'], ['a/b/c']))
 def testChangeTestPatterns_RemoveAndAdd_ReturnsAddedAndRemoved(self):
     self._AddSampleTestData()
     added = {
         'TheMaster/TheBot/Suite1/aaa',
     }
     removed = {
         'TheMaster/TheBot/Suite2/ccc',
         'TheMaster/TheBot/Suite2/ddd',
     }
     self.assertEqual(
         (added, removed),
         edit_config_handler._ChangeTestPatterns(['*/*/Suite2/*'],
                                                 ['*/*/*/aaa']))
 def testChangeTestPatterns_RemoveAndAdd_ReturnsAddedAndRemoved(self):
   self._AddSampleTestData()
   added = {
       'TheMaster/TheBot/Suite1/aaa',
   }
   removed = {
       'TheMaster/TheBot/Suite2/ccc',
       'TheMaster/TheBot/Suite2/ddd',
   }
   self.assertEqual(
       (added, removed),
       edit_config_handler._ChangeTestPatterns(
           ['*/*/Suite2/*'], ['*/*/*/aaa']))
 def testChangeTestPatterns_OnlyRemove_ReturnsEmptySetAndRemoved(self):
     self._AddSampleTestData()
     self.assertEqual((set(), {'TheMaster/TheBot/Suite1/bbb'}),
                      edit_config_handler._ChangeTestPatterns(
                          ['*/*/*/aaa', '*/*/Suite1/bbb'], ['*/*/*/aaa']))
 def testChangeTestPatterns_OnlyAdd_ReturnsAddedAndEmptySet(self):
     self._AddSampleTestData()
     self.assertEqual(({'TheMaster/TheBot/Suite1/aaa'}, set()),
                      edit_config_handler._ChangeTestPatterns(
                          ['*/*/*/bbb'], ['*/*/*/aaa', '*/*/*/bbb']))
 def testChangeTestPatterns_NoneValue_RaisesTypeError(self):
     with self.assertRaises(TypeError):
         edit_config_handler._ChangeTestPatterns('a/b/c', None)
 def testChangeTestPatterns_CanTakeSetsAsArguments(self):
     self._AddSampleTestData()
     self.assertEqual(
         ({'TheMaster/TheBot/Suite1/aaa'}, set()),
         edit_config_handler._ChangeTestPatterns(set(), {'*/*/Suite1/aaa'}))
 def testChangeTestPatterns_OnlyRemove_ReturnsEmptySetAndRemoved(self):
   self._AddSampleTestData()
   self.assertEqual(
       (set(), {'TheMaster/TheBot/Suite1/bbb'}),
       edit_config_handler._ChangeTestPatterns(
           ['*/*/*/aaa', '*/*/Suite1/bbb'], ['*/*/*/aaa']))
Exemplo n.º 10
0
 def testChangeTestPatterns_OnlyAdd_ReturnsAddedAndEmptySet(self):
   self._AddSampleTestData()
   self.assertEqual(
       ({'TheMaster/TheBot/Suite1/aaa'}, set()),
       edit_config_handler._ChangeTestPatterns(
           ['*/*/*/bbb'], ['*/*/*/aaa', '*/*/*/bbb']))
Exemplo n.º 11
0
 def testChangeTestPatterns_NoneValue_RaisesTypeError(self):
   with self.assertRaises(TypeError):
     edit_config_handler._ChangeTestPatterns('a/b/c', None)
Exemplo n.º 12
0
 def testChangeTestPatterns_CanTakeSetsAsArguments(self):
   self._AddSampleTestData()
   self.assertEqual(
       ({'TheMaster/TheBot/Suite1/aaa'}, set()),
       edit_config_handler._ChangeTestPatterns(set(), {'*/*/Suite1/aaa'}))