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())
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)
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)
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)
def test_is_empty_true(self): """Test empty when group has nothing in it""" gb = GroupBuilder('gb') self.assertEqual(gb.is_empty(), True)
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())
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())
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())
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())
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())
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())