def test_works(self, get_provider_mock, self_config_set_mock): TESTS_DIR = os.path.dirname(os.path.abspath(__file__)) get_provider_mock.return_value = fs.Provider( os.path.join(TESTS_DIR, 'test_data')) # See test_data/... layout. self_config_set_mock.return_value = 'services/auth-service-app-id' revs = config.get_latest_revs_async().get_result() self.assertEqual(sorted(revs, key=lambda r: r.project_id), [ config.RealmsCfgRev( project_id='@internal', config_rev='unknown', config_digest='90549bf56e8be6c0ff6001d2376db' + 'def519b97cc89e65b2813237b252300dea8', config_body='realms {\n name: "internal-realm"\n}\n', perms_rev=None, ), config.RealmsCfgRev( project_id='proj1', config_rev='unknown', config_digest='05105846cbabf80e1ab2979b7787' + 'f1df1aca9751661fe4b4d28494e0b442459b', config_body='realms {\n name: "realm1"\n}\n', perms_rev=None, ), config.RealmsCfgRev( project_id='proj2', config_rev='unknown', config_digest='fe0857c4fe4282083c0295ee835e7' + '96403027d13c652f4959a0c6a41957dbc18', config_body='realms {\n name: "realm2"\n}\n', perms_rev=None, ), ])
def setUp(self): super(FsTestCase, self).setUp() self.provider = fs.Provider(CONFIG_ROOT) self.empty_provider = fs.Provider('nonexistent')