<s> import unittest <EOL> import datafilereader <EOL> class TestParents ( unittest . TestCase ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> cls . project = datafilereader . construct_project ( <EOL> datafilereader . SIMPLE_TEST_SUITE_PATH ) <EOL> cls . directory = cls . project . data <EOL> cls . test = datafilereader . get_ctrl_by_name ( <EOL> '<STR_LIT>' , cls . project . datafiles ) <EOL> cls . resource = datafilereader . get_ctrl_by_name ( <EOL> datafilereader . SIMPLE_TEST_SUITE_RESOURCE_NAME , <EOL> cls . project . datafiles ) <EOL> cls . external_resource = datafilereader . get_ctrl_by_name ( <EOL> '<STR_LIT>' , cls . project . datafiles ) <EOL> @ classmethod <EOL> def tearDownClass ( cls ) : <EOL> cls . project . close ( ) <EOL> def test_test_suite_parent_is_directory ( self ) : <EOL> self . assertEquals ( self . test . parent , self . directory ) <EOL> self . assertTrue ( self . test in self . directory . children ) <EOL> def test_local_resource_parent_is_directory ( self ) : <EOL> self . assertEquals ( self . resource . parent , self . directory ) <EOL> self . assertTrue ( self . resource in self . directory . children ) <EOL> def test_external_resource_parent_is_undefined ( self ) : <EOL> self . assertEquals ( self . external_resource . parent , None ) <EOL> self . assertTrue ( self . external_resource not in self . directory . children ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
