Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@asynctest.ignore_loop
def test_help_msg_falsy(self):
list_entry = "!help - This help message"
self.hp.add_help_message("")
self.assertEqual(len(self.hp.help_msg_list), 1)
self.assertTrue(list_entry in self.hp.help_msg_list)
self.hp.add_help_message([])
self.assertEqual(len(self.hp.help_msg_list), 1)
self.assertTrue(list_entry in self.hp.help_msg_list)
self.hp.add_help_message(0)
self.assertEqual(len(self.hp.help_msg_list), 1)
self.assertTrue(list_entry in self.hp.help_msg_list)
@asynctest.ignore_loop
def test_empty_plugin_list(self):
self.robot.plugin_list = []
self.robot.initialize_static_plugins()
self.assertEqual(len(self.robot.plugin_list), 2)
@asynctest.ignore_loop
def test_social(self):
self.metadoc.query("social")
assert self.metadoc.activity
@asynctest.ignore_loop
def test_query_all(self):
result = self.metadoc.query()
assert result
@asynctest.ignore_loop
def test_string_ends_with_nnp(self):
self.perceptron_tagger = AveragedPerceptronTagger(autoload=True)
test_sentence = "The extraordinary phenomenon of fake news spread by Facebook and other \
social media during the 2016 presidential election has been largely portrayed as a lucky break for Donald Trump"
tags = self.perceptron_tagger.tag(test_sentence)
entities = self.perceptron_tagger.named_entities(tags)
assert tags[len(tags)-1][1] == "NNP"
assert "Donald Trump" in entities
@asynctest.ignore_loop
def test_no_html(self):
metadoc = Metadoc(url=self.url)
metadoc.query()
@asynctest.ignore_loop
def test_user_return_string(self):
self.su.id = "SU01"
self.su.name = "User One"
self.su.deleted = False
self.su.is_admin = False
self.su.has_2fa = True
user_json = json.loads(str(self.su))
self.assertEqual(user_json.get('id'), "SU01")
self.assertEqual(user_json.get('name'), "User One")
self.assertEqual(user_json.get('deleted'), False)
self.assertEqual(user_json.get('is_admin'), False)
self.assertEqual(user_json.get('has_2fa'), True)
self.assertEqual(user_json.get('is_owner'), "")
@asynctest.ignore_loop
def test_vault(self):
self.assertEqual(len(list(self.vault.walk_disk())), 8)
@asynctest.ignore_loop
def test_domain(self):
self.metadoc.query("domain")
assert self.metadoc.domain
@asynctest.ignore_loop
def test_schedule_equality(self):
sched_1 = PagerdutySchedule(
description="sched_1",
name="Schedule 1",
)
sched_2 = PagerdutySchedule(
description="sched_2",
name="Schedule 2",
)
self.assertNotEqual(sched_1, sched_2)
sched_dict = {
"description": "sched_1",
}
sched_2.load(sched_dict)
self.assertNotEqual(sched_1, sched_2)
sched_dict = {