MCPcopy Create free account
hub / github.com/apache/impala / setup_method

Method setup_method

tests/metadata/test_hdfs_encryption.py:69–81  ·  view source on GitHub ↗
(self, method)

Source from the content-addressed store, hash-verified

67 v.get_value('key_tbl_dir') is not None)
68
69 def setup_method(self, method):
70 super().setup_method(method)
71 self.__cleanup()
72 self.client.execute('create database if not exists %s' % TEST_DB)
73 self.client.execute('use %s' % TEST_DB)
74 self.hdfs_client.make_dir(TMP_DIR)
75 # Few tests depend on the .Trash directory being present. In case it doesn't
76 # exist, we create a random text file and delete it so that hdfs recreates
77 # the hierarchy of trash
78 if not self.hdfs_client.exists("/user/{0}/.Trash/".format(getpass.getuser())):
79 self.hdfs_client.create_file("/test-warehouse/random", file_data="random")
80 rc, stdout, stderr = exec_process("hadoop fs -rm /test-warehouse/random")
81 assert rc == 0, 'Error re-creating trash: %s %s' % (stdout, stderr)
82
83 def teardown_method(self, method):
84 self.__cleanup()

Callers

nothing calls this directly

Calls 7

__cleanupMethod · 0.95
exec_processFunction · 0.90
executeMethod · 0.45
make_dirMethod · 0.45
existsMethod · 0.45
formatMethod · 0.45
create_fileMethod · 0.45

Tested by

no test coverage detected