def test_is_valid_true_with_all_values_set(self): element = EmptyNode( main_index=1, sub_index=2, form='Form', lemma='Lemma', upos=UposTag.X, xpos='XPOS', feats={'foo': 'bar'}, deps={'baz': 'qux'}, misc='Misc' ) self.assertTrue(element.is_valid())
def test_is_valid_true_with_sub_index_greater_than_zero(self): element = EmptyNode(main_index=42, sub_index=1) self.assertTrue(element.is_valid())
def test_is_valid_false_with_sub_index_equal_to_zero(self): element = EmptyNode(main_index=42, sub_index=0) self.assertFalse(element.is_valid())
def test_is_valid_true_with_main_index_equal_to_zero(self): element = EmptyNode(main_index=0, sub_index=42) self.assertTrue(element.is_valid())
def test_is_valid_false_with_sub_index_less_than_zero(self): element = EmptyNode(main_index=42, sub_index=-1) self.assertFalse(element.is_valid())
def test_is_valid_false_with_sub_index_is_not_set(self): element = EmptyNode(main_index=42) self.assertFalse(element.is_valid())
def test_is_valid_false_with_no_values_set(self): element = EmptyNode() self.assertFalse(element.is_valid())