示例#1
0
 def test_is_empty_false_group_dataset(self):
     """Test is_empty() when group has a subgroup with a dataset"""
     gb1 = GroupBuilder(
         'my_subgroup',
         datasets={'my_dataset': DatasetBuilder('my_dataset')})
     gb2 = GroupBuilder('gb', {'my_subgroup': gb1})
     self.assertFalse(gb2.is_empty())
示例#2
0
 def test_is_empty_false_group_attribute(self):
     """Test is_empty() when group has subgroup with an attribute"""
     gb = GroupBuilder(
         'gb', {
             'my_subgroup':
             GroupBuilder('my_subgroup',
                          attributes={'my_attr': 'attr_value'})
         })
     self.assertEqual(gb.is_empty(), False)
示例#3
0
 def test_is_empty_false_group_dataset(self):
     """Test is_empty() when group has a subgroup with a dataset"""
     gb = GroupBuilder(
         'gb', {
             'my_subgroup':
             GroupBuilder(
                 'my_subgroup',
                 datasets={'my_dataset': DatasetBuilder('my_dataset')})
         })
     self.assertEqual(gb.is_empty(), False)
示例#4
0
 def test_is_empty_true_group(self):
     """Test is_empty() when group has an empty subgroup"""
     gb = GroupBuilder('gb', {'my_subgroup': GroupBuilder('my_subgroup')})
     self.assertEqual(gb.is_empty(), True)
示例#5
0
 def test_is_empty_true(self):
     """Test empty when group has nothing in it"""
     gb = GroupBuilder('gb')
     self.assertEqual(gb.is_empty(), True)
示例#6
0
 def test_is_empty_false_group_link(self):
     """Test is_empty() when group has subgroup with a link"""
     gb1 = GroupBuilder('target')
     gb2 = GroupBuilder('my_subgroup', links={'my_link': LinkBuilder(gb1)})
     gb3 = GroupBuilder('gb', {'my_subgroup': gb2})
     self.assertFalse(gb3.is_empty())
示例#7
0
 def test_is_empty_false_link(self):
     """Test is_empty() when group has a link"""
     gb1 = GroupBuilder('target')
     gb2 = GroupBuilder('gb', links={'my_link': LinkBuilder(gb1)})
     self.assertFalse(gb2.is_empty())
示例#8
0
 def test_is_empty_false_group_attribute(self):
     """Test is_empty() when group has subgroup with an attribute"""
     gb1 = GroupBuilder('my_subgroup', attributes={'my_attr': 'attr_value'})
     gb2 = GroupBuilder('gb', {'my_subgroup': gb1})
     self.assertFalse(gb2.is_empty())
示例#9
0
 def test_is_empty_false_attribute(self):
     """Test is_empty() when group has an attribute"""
     gb = GroupBuilder('gb', attributes={'my_attr': 'attr_value'})
     self.assertFalse(gb.is_empty())
示例#10
0
 def test_is_empty_false_dataset(self):
     """Test is_empty() when group has a dataset"""
     gb = GroupBuilder(
         'gb', datasets={'my_dataset': DatasetBuilder('my_dataset')})
     self.assertFalse(gb.is_empty())
示例#11
0
 def test_is_empty_true_group_empty(self):
     """Test is_empty() when group has an empty subgroup"""
     gb1 = GroupBuilder('my_subgroup')
     gb2 = GroupBuilder('gb', {'my_subgroup': gb1})
     self.assertTrue(gb2.is_empty())