Ejemplo n.º 1
0
 def testSubTestsDict(self):
     paths = [
         ['a', 'b', 'c'],
         ['a', 'b', 'c'],
         ['a', 'b', 'd'],
     ]
     expected = {
         'a': {
             'has_rows': False,
             'sub_tests': {
                 'b': {
                     'has_rows': False,
                     'sub_tests': {
                         'c': {
                             'has_rows': True,
                             'sub_tests': {}
                         },
                         'd': {
                             'has_rows': True,
                             'sub_tests': {}
                         },
                     },
                 },
             },
         },
     }
     self.assertEqual(expected, list_tests._SubTestsDict(paths, False))
Ejemplo n.º 2
0
 def testSubTestsDict(self):
     paths = [
         'a/b/c',
         'a/b/c',
         'a/b/d',
     ]
     expected = {
         'a': {
             'has_rows': False,
             'sub_tests': {
                 'b': {
                     'has_rows': False,
                     'sub_tests': {
                         'c': {
                             'has_rows': True,
                             'sub_tests': {}
                         },
                         'd': {
                             'has_rows': True,
                             'sub_tests': {}
                         },
                     },
                 },
             },
         },
     }
     self.assertEqual(expected, list_tests._SubTestsDict(paths))
Ejemplo n.º 3
0
 def testSubTestsDict_TopLevel_HasRows_False(self):
   paths = [
       ['a', 'b'],
       ['a', 'c'],
   ]
   expected = {
       'a': {
           'has_rows': False,
           'sub_tests': {
               'b': {'has_rows': True, 'sub_tests': {}},
               'c': {'has_rows': True, 'sub_tests': {}},
           },
       },
   }
   self.assertEqual(
       expected, list_tests._SubTestsDict(paths, False))
Ejemplo n.º 4
0
 def testSubTestsDict(self):
     paths = ["a/b/c", "a/b/c", "a/b/d"]
     expected = {
         "a": {
             "has_rows": False,
             "sub_tests": {
                 "b": {
                     "has_rows": False,
                     "sub_tests": {
                         "c": {"has_rows": True, "sub_tests": {}},
                         "d": {"has_rows": True, "sub_tests": {}},
                     },
                 }
             },
         }
     }
     self.assertEqual(expected, list_tests._SubTestsDict(paths))
Ejemplo n.º 5
0
 def testSubTestsDict_RepeatedPathIgnored(self):
   paths = [
       ['a', 'b'],
       ['a', 'c'],
       ['a', 'b'],
   ]
   expected = {
       'a': {
           'has_rows': False,
           'sub_tests': {
               'b': {'has_rows': True, 'sub_tests': {}},
               'c': {'has_rows': True, 'sub_tests': {}},
           },
       },
   }
   self.assertEqual(
       expected, list_tests._SubTestsDict(paths, False))
Ejemplo n.º 6
0
 def testSubTestsDict_Deprecated(self):
     paths = [
         ['a'],
         ['a', 'b'],
     ]
     expected = {
         'a': {
             'has_rows': True,
             'deprecated': True,
             'sub_tests': {
                 'b': {
                     'has_rows': True,
                     'deprecated': True,
                     'sub_tests': {},
                 },
             },
         },
     }
     self.assertEqual(expected, list_tests._SubTestsDict(paths, True))
Ejemplo n.º 7
0
 def testSubTestsDict_Deprecated(self):
   paths = [
       ['a'],
       ['a', 'b'],
   ]
   expected = {
       'a': {
           'has_rows': True,
           'deprecated': True,
           'sub_tests': {
               'b': {
                   'has_rows': True,
                   'deprecated': True,
                   'sub_tests': {},
               },
           },
       },
   }
   self.assertEqual(
       expected, list_tests._SubTestsDict(paths, True))
Ejemplo n.º 8
0
 def testSubTestsDict(self):
   paths = [
       'a/b/c',
       'a/b/c',
       'a/b/d',
   ]
   expected = {
       'a': {
           'has_rows': False,
           'sub_tests': {
               'b': {
                   'has_rows': False,
                   'sub_tests': {
                       'c': {'has_rows': True, 'sub_tests': {}},
                       'd': {'has_rows': True, 'sub_tests': {}},
                   },
               },
           },
       },
   }
   self.assertEqual(
       expected, list_tests._SubTestsDict(paths, False))