Esempio n. 1
0
	def test_create_instance_with_no_location_argument(self):
		invalid_args = {}
		try:
			thread = TwitterThread(self.db, self.scorer, self.query, invalid_args)
			self.fail()
		except KeyError:
			pass
Esempio n. 2
0
    def search(self, query, args):
        self.threads = []
        if args['GooglePlus']:
            self.threads.append(
                GooglePlusThread(self.db, self.scorer, query, args))
        if args['Twitter']:
            self.threads.append(
                TwitterThread(self.db, self.scorer, query, args))

        for thread in self.threads:
            thread.start()
        for thread in self.threads:
            thread.join()
 def test_create_instance_with_invalid_args_argument(self):
     try:
         thread = TwitterThread(self.db, self.scorer, self.query, None)
         self.fail()
     except TypeError:
         pass
 def test_create_instance_without_required_arguments(self):
     try:
         thread = TwitterThread()
         self.fail()
     except TypeError:
         pass
 def test_create_instance_with_valid_arguments(self):
     thread = TwitterThread(self.db, self.scorer, self.query, self.args)
     self.assertIsInstance(thread, TwitterThread)