Example #1
0
  def _test_create_new(self):
    FakeSource.create_new(self.handler)
    self.assertEqual(1, FakeSource.all().count())

    tasks = self.taskqueue_stub.GetTasks('poll')
    self.assertEqual(1, len(tasks))
    source = FakeSource.all().get()
    self.assertEqual('/_ah/queue/poll', tasks[0]['url'])
    params = testutil.get_task_params(tasks[0])
    self.assertEqual(str(source.key()), params['source_key'])
    self.assertEqual('1970-01-01-00-00-00',
                     params['last_polled'])
Example #2
0
 def setUp(self):
   super(PollTest, self).setUp()
   self.source = FakeSource.new(self.handler)
   self.source.save()
   self.source.set_salmon([self.salmon_vars])
   self.task_params = {'source_key': self.source.key(),
                       'last_polled': '1970-01-01-00-00-00'}
Example #3
0
 def setUp(self):
   super(ScanTest, self).setUp()
   self.source = FakeSource.new(self.handler)
   self.source.save()
   self.source.set_salmon([self.salmon_vars])
   self.task_params = {'source_key': self.source.key(),
                       'last_scanned': '1970-01-01-00-00-00'}
Example #4
0
 def test_create_new_already_exists(self):
   FakeSource.new(self.handler).save()
   FakeSource.key_name_counter -= 1
   self._test_create_new()
Example #5
0
 def test_create_new(self):
   self.assertEqual(0, FakeSource.all().count())
   self._test_create_new()