MCPcopy Create free account
hub / github.com/comaps/comaps / CreateAPI

Function CreateAPI

libs/editor/osm_auth_tests/server_api_test.cpp:34–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace
33{
34ServerApi06 CreateAPI()
35{
36 OsmOAuth auth = OsmOAuth::DevServerAuth();
37 bool result;
38 TEST_NO_THROW(result = auth.AuthorizePassword(kValidOsmUser, kValidOsmPassword), ());
39 TEST_EQUAL(result, true, ("Invalid login or password?"));
40 TEST(auth.IsAuthorized(), ("OSM authorization"));
41 ServerApi06 api(auth);
42 // Test user preferences reading along the way.
43 osm::UserPreferences prefs;
44 TEST_NO_THROW(prefs = api.GetUserPreferences(), ());
45 TEST_EQUAL(prefs.m_displayName, kValidOsmUser, ("User display name"));
46 TEST_EQUAL(prefs.m_id, 14235, ("User id"));
47 return api;
48}
49
50// Returns random coordinate to avoid races when several workers run tests at the same time.
51ms::LatLon RandomCoordinate()

Callers 1

UNIT_TESTFunction · 0.85

Calls 4

TESTFunction · 0.85
AuthorizePasswordMethod · 0.80
IsAuthorizedMethod · 0.80
GetUserPreferencesMethod · 0.80

Tested by

no test coverage detected