示例#1
0
  def test_get_projects(self):
    """Test that all projects are listed."""
    my_project = model_helpers.create_project()
    my_project.put()

    response = self._make_api_call('get_projects')
    expected = {u'items': [
      my_project.ToMessage(),
    ]}

    resp = model_helpers.convert_items_to_protos(models.Project, response.json)
    self.assertEqual(expected, resp)
示例#2
0
  def test_repo_list(self):
    """Test that calling repo.list yields an list of scanned repos."""
    my_repo = model_helpers.create_repo()
    my_repo.put()
    second_repo = model_helpers.create_repo()
    second_repo.repo = 'cooler_src'
    second_repo.put()

    response = self._make_api_call('get_repos')

    expected = {u'items': [
      my_repo.ToMessage(),
      second_repo.ToMessage(),
    ]}

    resp = model_helpers.convert_items_to_protos(models.Repo, response.json)
    self.assertEqual(expected, resp)