def test_mongo_insert(self): """Function: test_mongo_insert Description: Test inserting data into Mongo database. Arguments: """ args_array = {"-n": True, "-m": True} server_usage.post_process(self.proc_data, args_array, self.cfg) coll = mongo_libs.crt_coll_inst(self.cfg, self.cfg.db, self.cfg.coll) coll.connect() self.assertTrue(coll.coll_cnt() == 1)
def test_format_print(self): """Function: test_format_print Description: Test printing formatted data. Arguments: """ args_array = {"-f": True} self.assertFalse(server_usage.post_process({}, args_array, self.cfg))
def test_mongo_false(self): """Function: test_mongo_false Description: Test with mongo option set to false. Arguments: """ args_array = {"-n": True} self.assertFalse( server_usage.post_process(self.proc_data, args_array, self.cfg))
def test_suppress_true(self): """Function: test_suppress_true Description: Test with suppress option set to true. Arguments: """ args_array = {"-n": True} self.assertFalse( server_usage.post_process(self.proc_data, args_array, self.cfg))
def test_print_format(self, mock_display): """Function: test_print_format Description: Test with printing formatted data. Arguments: """ args_array = {"-f": True} mock_display.return_value = True self.assertFalse( server_usage.post_process(self.proc_data, args_array, self.cfg))
def test_mongo_true(self, mock_mongo): """Function: test_mongo_true Description: Test with mongo option set to true. Arguments: """ args_array = {"-n": True, "-m": True} mock_mongo.return_value = True self.assertFalse( server_usage.post_process(self.proc_data, args_array, self.cfg))
def test_suppress_false(self): """Function: test_suppress_false Description: Test with suppress option set to false. Arguments: """ args_array = {} with gen_libs.no_std_out(): self.assertFalse( server_usage.post_process(self.proc_data, args_array, self.cfg))
def test_print_raw(self): """Function: test_print_raw Description: Test with printing unformatted data. Arguments: """ args_array = {} with gen_libs.no_std_out(): self.assertFalse( server_usage.post_process(self.proc_data, args_array, self.cfg))