This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add Makefile target check, minor updates to get a clean test run
- Loading branch information
Showing
7 changed files
with
113 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/usr/bin/python3 | ||
|
||
# Copyright (c) 2022, 2023 Humanitarian OpenStreetMap Team | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
|
||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
|
||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
# Humanitarian OpenStreetmap Team | ||
# 1100 13th Street NW Suite 800 Washington, D.C. 20005 | ||
# <[email protected]> | ||
|
||
import argparse | ||
import logging | ||
import sys | ||
import os | ||
from sys import argv | ||
# from tm_admin.organizations.organizations_proto import OrganizationsMessage | ||
#from tm_admin.yamlfile import YamlFile | ||
from tm_admin.organizations.organizations import OrganizationsDB | ||
from tm_admin.types_tm import Organizationtype, Mappinglevel | ||
from datetime import datetime | ||
from tm_admin.teams.teams import TeamsDB | ||
|
||
# Instantiate logger | ||
log = logging.getLogger(__name__) | ||
|
||
import tm_admin as tma | ||
rootdir = tma.__path__[0] | ||
|
||
# average mapping time per task | ||
# average validation ti8me per task | ||
# Estimated time to finish mapping | ||
# Estimated time to finish validation | ||
# mappers per project | ||
# validators per project | ||
# total contributors | ||
# users by level | ||
|
||
## task Status | ||
# tasks locked for validation | ||
# finished tasks | ||
# ready for validation | ||
# available for mapping | ||
# locked for mapping | ||
# more mapping needed | ||
|
||
|
||
# FIXME: For now these tests assume you have a local postgres installed | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-v", "--verbose", nargs="?", const="0", help="verbose output") | ||
parser.add_argument("-u", "--uri", default='localhost/tm_admin', help="Database URI") | ||
args = parser.parse_args() | ||
# if verbose, dump to the terminal. | ||
log_level = os.getenv("LOG_LEVEL", default="INFO") | ||
if args.verbose is not None: | ||
log_level = logging.DEBUG | ||
|
||
logging.basicConfig( | ||
level=log_level, | ||
format=("%(asctime)s.%(msecs)03d [%(levelname)s] " "%(name)s | %(funcName)s:%(lineno)d | %(message)s"), | ||
datefmt="%y-%m-%d %H:%M:%S", | ||
stream=sys.stdout, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,7 +203,7 @@ async def register_user(): | |
# osm_id, username, changeset_count, picture_url, email | ||
# The id is generated by postgres, so we don't supply it. | ||
ut = UsersTable(username='foobar', name='barfoo', picture_url='URI', email_address="[email protected]", mapping_level='INTERMEDIATE', role='VALIDATOR') | ||
new = user.createTable(ut) | ||
# new = user.createTable(ut) | ||
entry = await user.getByName(ut.data['name']) | ||
# assert entry['id'] > 0 | ||
|
||
|